Changes in uspace/lib/c/generic/vfs/vfs.c [89e780d:64d2b10] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/vfs/vfs.c
r89e780d r64d2b10 69 69 char *ncwd_path; 70 70 char *ncwd_path_nc; 71 size_t total_size;72 71 73 72 fibril_mutex_lock(&cwd_mutex); … … 78 77 return NULL; 79 78 } 80 total_size = cwd_size + 1 + size + 1; 81 ncwd_path_nc = malloc(total_size); 79 ncwd_path_nc = malloc(cwd_size + 1 + size + 1); 82 80 if (!ncwd_path_nc) { 83 81 fibril_mutex_unlock(&cwd_mutex); 84 82 return NULL; 85 83 } 86 str_cpy(ncwd_path_nc, total_size, cwd_path);84 str_cpy(ncwd_path_nc, cwd_size + 1 + size + 1, cwd_path); 87 85 ncwd_path_nc[cwd_size] = '/'; 88 86 ncwd_path_nc[cwd_size + 1] = '\0'; 89 87 } else { 90 total_size = size + 1; 91 ncwd_path_nc = malloc(total_size); 88 ncwd_path_nc = malloc(size + 1); 92 89 if (!ncwd_path_nc) { 93 90 fibril_mutex_unlock(&cwd_mutex); … … 96 93 ncwd_path_nc[0] = '\0'; 97 94 } 98 str_append(ncwd_path_nc, total_size, path);95 str_append(ncwd_path_nc, cwd_size + 1 + size + 1, path); 99 96 ncwd_path = canonify(ncwd_path_nc, retlen); 100 97 if (!ncwd_path) {
Note:
See TracChangeset
for help on using the changeset viewer.