Changeset 08e103d4 in mainline for uspace/app/bdsh/cmds/modules/ls/ls.c
- Timestamp:
- 2019-02-05T18:26:05Z (5 years ago)
- Children:
- 1d2f85e
- Parents:
- d066259
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2019-02-05 16:16:55)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2019-02-05 18:26:05)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/ls/ls.c
rd066259 r08e103d4 174 174 175 175 /* fill the name field */ 176 tosort[nbdirs].name = (char *) malloc(str_ size(dp->d_name) + 1);176 tosort[nbdirs].name = (char *) malloc(str_bytes(dp->d_name) + 1); 177 177 if (!tosort[nbdirs].name) { 178 178 cli_error(CL_ENOMEM, "ls: failed to scan %s", d); … … 180 180 } 181 181 182 str_cpy(tosort[nbdirs].name, str_ size(dp->d_name) + 1, dp->d_name);182 str_cpy(tosort[nbdirs].name, str_bytes(dp->d_name) + 1, dp->d_name); 183 183 len = snprintf(buff, PATH_MAX - 1, "%s/%s", d, tosort[nbdirs].name); 184 184 buff[len] = '\0'; … … 264 264 memset(subdir_path, 0, PATH_MAX); 265 265 266 if (str_ size(subdir_path) + str_size(path) + 1 <= PATH_MAX)266 if (str_bytes(subdir_path) + str_bytes(path) + 1 <= PATH_MAX) 267 267 str_append(subdir_path, PATH_MAX, path); 268 if (path[str_ size(path) - 1] != '/' &&269 str_ size(subdir_path) + str_size(trailing_slash) + 1 <= PATH_MAX)268 if (path[str_bytes(path) - 1] != '/' && 269 str_bytes(subdir_path) + str_bytes(trailing_slash) + 1 <= PATH_MAX) 270 270 str_append(subdir_path, PATH_MAX, trailing_slash); 271 if (str_ size(subdir_path) +272 str_ size(dir_list[i].name) + 1 <= PATH_MAX)271 if (str_bytes(subdir_path) + 272 str_bytes(dir_list[i].name) + 1 <= PATH_MAX) 273 273 str_append(subdir_path, PATH_MAX, dir_list[i].name); 274 274
Note:
See TracChangeset
for help on using the changeset viewer.