Permalink
Browse files

"aliasing of input and output is not allowed on snprintf and might ca…

…use the string to be truncated" - Replaces snprintf with strncat. Patch by Kjetil|.
  • Loading branch information...
1 parent 3ee9ec8 commit 6c154e571677d34a094f47f102e3436926864925 jorgenpt committed Feb 19, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/lib/cache.c
View
@@ -27,7 +27,7 @@ bool cache_init(){
DSFYDEBUG("Error creating cache directory. errno = %d\n", errno);
return false;
}
- snprintf(cache_directory, PATH_MAX, "%s/despotify", cache_directory);
+ strncat(cache_directory,"/despotify",PATH_MAX-strlen(cache_directory)-1);
}
else{
DSFYDEBUG("Error getting $HOME.\n");

0 comments on commit 6c154e5

Please sign in to comment.