Browse Source

move strndup back to string.c - used by strdup

tags/v0.9.3
Holger Lubitz 17 years ago
parent
commit
6b6dbe5600
1 changed files with 0 additions and 15 deletions
  1. 0
    15
      src/core/stringextra.c

+ 0
- 15
src/core/stringextra.c View File

@@ -271,18 +271,3 @@ void * memscan(const void * addr, int c, size_t size)
271 271
   	return (void *) p;
272 272
 }
273 273
 #endif
274
-
275
-char * strndup(const char *s, size_t n)
276
-{
277
-	size_t len = strlen(s);
278
-	char *new;
279
-
280
-	if (len>n)
281
-		len = n;
282
-	new = malloc(len+1);
283
-	if (new) {
284
-		new[len] = '\0';
285
-		memcpy(new,s,len);
286
-	}
287
-	return new;
288
-}

Loading…
Cancel
Save