Changeset 450

Show
Ignore:
Timestamp:
03/30/06 01:54:38 (3 years ago)
Author:
common
Message:

shellcode-signatures
- include config.h in parser.y else it does not compile on any but freebsd, as strndup gets redefined

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nepenthes/trunk/modules/shellcode-signatures/parser.y

    r448 r450  
    11/* $Id$ */ 
    22%{ 
    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     
    1012 
    1113        inline void string_reset(); 
     
    255257 
    256258#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 
     260char *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
    267270#endif /* HAVE_STRNDUP */ 
    268271