Pages:<< prev   1  next >>
Sorcerer

GroupMembers
Posts600
JoinedDec 3, 2008
  Well I installed it and only got one warning...
In function 'strncat',
inlined from 'check_alias' at alias.c:158:
/usr/include/bits/string3.h:153: warning: call to __builtin___strncat_chk might overflow destination buffer
Any ideas?
In function 'strncat',
inlined from 'check_alias' at alias.c:158:
/usr/include/bits/string3.h:153: warning: call to __builtin___strncat_chk might overflow destination buffer
strncat( arg, argument, MAX_INPUT_LENGTH );
Any ideas?
Sorcerer

GroupMembers
Posts902
JoinedJan 29, 2007
  What's the declaration for arg and argument here?
  
  
 
Sorcerer

GroupMembers
Posts600
JoinedDec 3, 2008
bool check_alias( CHAR_DATA * ch, char *command, char *argument )
{
   char arg[MAX_INPUT_LENGTH];
  
  
 Sorcerer

GroupMembers
Posts902
JoinedJan 29, 2007
  It's probably complaining because you need space for the zero byte. Try 
strncat( arg, argument, MAX_INPUT_LENGTH-1 );
  
  
 
strncat( arg, argument, MAX_INPUT_LENGTH-1 );
 Pages:<< prev   1  next >>