Changeset e436cfe in mainline for uspace/app/bdsh/util.c


Ignore:
Timestamp:
2008-10-02T07:49:38Z (16 years ago)
Author:
Tim Post <echo@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c2ad500
Parents:
119c335
Message:

cli_redup() should be size_t and return as such to avoid undefined behavior with large strings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/util.c

    r119c335 re436cfe  
    7676 * Return -1 on failure, or the length of the copied string on success.
    7777 */
    78 int cli_redup(char **s1, const char *s2)
     78size_t cli_redup(char **s1, const char *s2)
    7979{
    8080        size_t len = strlen(s2) + 1;
     
    9393        memcpy(*s1, s2, len);
    9494        cli_errno = CL_EOK;
    95         return (int) len;
     95        return len;
    9696}
    9797
Note: See TracChangeset for help on using the changeset viewer.