Changeset 92fd52d7 in mainline for uspace/lib/libc/generic/string.c


Ignore:
Timestamp:
2009-04-09T21:16:50Z (15 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7afb4a5
Parents:
a2c58f6
Message:

Nuke strcpy() and strcmp().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/generic/string.c

    ra2c58f6 r92fd52d7  
    607607}
    608608
    609 /** Count the number of characters in the string, not including terminating 0.
    610  *
    611  * @param str           String.
    612  * @return              Number of characters in string.
    613  */
    614 size_t strlen(const char *str)
    615 {
    616         size_t counter = 0;
    617 
    618         while (str[counter] != 0)
    619                 counter++;
    620 
    621         return counter;
    622 }
    623 
    624 int strcmp(const char *a, const char *b)
    625 {
    626         int c = 0;
    627        
    628         while (a[c] && b[c] && (!(a[c] - b[c])))
    629                 c++;
    630        
    631         return (a[c] - b[c]);
    632 }
    633 
    634609int strncmp(const char *a, const char *b, size_t n)
    635610{
     
    871846char * strdup(const char *s1)
    872847{
    873         size_t len = strlen(s1) + 1;
     848        size_t len = str_size(s1) + 1;
    874849        void *ret = malloc(len);
    875850
Note: See TracChangeset for help on using the changeset viewer.