Changeset 1d132ae in mainline for uspace/app/bdsh/util.c


Ignore:
Timestamp:
2008-10-03T09:09:55Z (16 years ago)
Author:
Tim Post <echo@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f2ef7fd
Parents:
d364e94
Message:

Eliminate unused functions in util.c

File:
1 edited

Legend:

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

    rd364e94 r1d132ae  
    6969        cli_errno = CL_EOK;
    7070        return (char *) memcpy(ret, s1, len);
    71 }
    72 
    73 /*
    74  * Take a previously allocated string (s1), re-size it to accept s2 and copy
    75  * the contents of s2 into s1.
    76  * Return -1 on failure, or the length of the copied string on success.
    77  */
    78 size_t cli_redup(char **s1, const char *s2)
    79 {
    80         size_t len;
    81 
    82         if (s2 == NULL)
    83                 return -1;
    84 
    85         len = strlen(s2) + 1;
    86 
    87         *s1 = realloc(*s1, len);
    88 
    89         if (*s1 == NULL) {
    90                 cli_errno = CL_ENOMEM;
    91                 return -1;
    92         }
    93 
    94         *s1[len] = '\0';
    95 
    96         memcpy(*s1, s2, len);
    97         cli_errno = CL_EOK;
    98 
    99         return len;
    10071}
    10172
Note: See TracChangeset for help on using the changeset viewer.