File: sblist_delete.c

package info (click to toggle)
microsocks 1.0.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 172 kB
  • sloc: ansic: 1,091; sh: 68; makefile: 48
file content (9 lines) | stat: -rw-r--r-- 270 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
#include "sblist.h"
#include <string.h>

void sblist_delete(sblist* l, size_t item) {
	if (l->count && item < l->count) {
		memmove(sblist_item_from_index(l, item), sblist_item_from_index(l, item + 1), (sblist_getsize(l) - (item + 1)) * l->itemsize);
		l->count--;
	}
}