1
0
Эх сурвалжийг харах

refactor: strcat instead of strcpy

Fabian Peter Hammerle 6 жил өмнө
parent
commit
ed4233d28f
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      rgpgfs.c

+ 1 - 1
rgpgfs.c

@@ -41,7 +41,7 @@ static int rgpgfs_encrypt(const char *source_path, char *cache_path) {
     return 1;
   }
   strcpy(cache_path, cache_dir);
-  strcpy(&cache_path[sizeof(cache_dir) - 1], source_path);
+  strcat(cache_path, source_path);
 
   if (rgpgfs_mkdirs(cache_path)) {
     perror("rgpgfs_encrypt: failed to create dirs");