Changeset a8bc7f8 in mainline


Ignore:
Timestamp:
2011-06-18T15:09:26Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2f2d4b71
Parents:
2e833cf7
Message:

Safer str_append

When the original string has already the size of the buffer, there
is no need to try to append anything to it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/str.c

    r2e833cf7 ra8bc7f8  
    540540
    541541        dstr_size = str_size(dest);
     542        if (dstr_size >= size) {
     543                return;
     544        }
    542545        str_cpy(dest + dstr_size, size - dstr_size, src);
    543546}
Note: See TracChangeset for help on using the changeset viewer.