Ignore:
Timestamp:
2019-02-05T18:26:05Z (5 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
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)
Message:

Use clearer naming for string length functions

This and the following commit change the names of functions, as well as
their documentation, to use unambiguous terms "bytes" and "code points"
instead of ambiguous terms "size", "length", and "characters".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/cmds/modules/ls/ls.c

    rd066259 r08e103d4  
    174174
    175175                /* 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);
    177177                if (!tosort[nbdirs].name) {
    178178                        cli_error(CL_ENOMEM, "ls: failed to scan %s", d);
     
    180180                }
    181181
    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);
    183183                len = snprintf(buff, PATH_MAX - 1, "%s/%s", d, tosort[nbdirs].name);
    184184                buff[len] = '\0';
     
    264264                memset(subdir_path, 0, PATH_MAX);
    265265
    266                 if (str_size(subdir_path) + str_size(path) + 1 <= PATH_MAX)
     266                if (str_bytes(subdir_path) + str_bytes(path) + 1 <= PATH_MAX)
    267267                        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)
    270270                        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)
    273273                        str_append(subdir_path, PATH_MAX, dir_list[i].name);
    274274
Note: See TracChangeset for help on using the changeset viewer.