Changeset 450
- Timestamp:
- 03/30/06 01:54:38 (3 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
nepenthes/trunk/modules/shellcode-signatures/parser.y
r448 r450 1 1 /* $Id$ */ 2 2 %{ 3 #define _GNU_SOURCE 4 #include <string.h> 5 #include <stdio.h> 6 #include <memory.h> 7 #include <errno.h> 8 9 #include "parser.h" 3 #define _GNU_SOURCE 4 #include <string.h> 5 #include <stdio.h> 6 #include <memory.h> 7 #include <errno.h> 8 9 #include "config.h" 10 #include "parser.h" 11 10 12 11 13 inline void string_reset(); … … 255 257 256 258 #ifndef HAVE_STRNDUP 257 // from http://www.unixpapa.com/incnote/string.html 258 char *strndup(const char *str, size_t len) 259 { 260 char *dup= (char *)malloc( len+1 ); 261 if (dup) { 262 strncpy(dup,str,len); 263 dup[len]= '\0'; 264 } 265 return dup; 266 } 259 // from http://www.unixpapa.com/incnote/string.html 260 char *strndup(const char *str, size_t len) 261 { 262 char *dup= (char *)malloc( len+1 ); 263 if ( dup ) 264 { 265 strncpy(dup,str,len); 266 dup[len]= '\0'; 267 } 268 return dup; 269 } 267 270 #endif /* HAVE_STRNDUP */ 268 271
