Project

General

Profile

« Previous | Next » 

Revision 2ee6ac00

Added by skyjake almost 13 years ago

Unix: Fixing compiler warnings

From strncat() man page: "If src contains n or more characters, strncat()
writes n+1 characters to dest (n from src plus the terminating null
byte). Therefore, the size of dest must be at least strlen(dest)+n+1."

Therefore it is necessary to set the n parameter of strncat to maxlen-1.

Also checking return value of getcwd().

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences