Changeset 08e103d4 in mainline for uspace/lib/sif/src/sif.c


Ignore:
Timestamp:
2019-02-05T18:26:05Z (6 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/lib/sif/src/sif.c

    rd066259 r08e103d4  
    702702{
    703703        char *str;
    704         size_t str_size;
     704        size_t str_bytes;
    705705        size_t sidx;
    706706        int c;
    707707        errno_t rc;
    708708
    709         str_size = 1;
     709        str_bytes = 1;
    710710        sidx = 0;
    711         str = malloc(str_size + 1);
     711        str = malloc(str_bytes + 1);
    712712        if (str == NULL)
    713713                return ENOMEM;
     
    737737                }
    738738
    739                 if (sidx >= str_size) {
    740                         str_size *= 2;
    741                         str = realloc(str, str_size + 1);
     739                if (sidx >= str_bytes) {
     740                        str_bytes *= 2;
     741                        str = realloc(str, str_bytes + 1);
    742742                        if (str == NULL) {
    743743                                rc = ENOMEM;
Note: See TracChangeset for help on using the changeset viewer.