Changeset 732bb0c in mainline for uspace/lib/libc


Ignore:
Timestamp:
2009-04-14T19:08:10Z (17 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4482bc7
Parents:
47a6708
Message:

Nuke strncmp().

Location:
uspace/lib/libc
Files:
3 edited

Legend:

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

    r47a6708 r732bb0c  
    387387                for (i = 0; long_options[i].name; i++) {
    388388                        /* find matching long option */
    389                         if (strncmp(current_argv, long_options[i].name,
    390                             current_argv_len))
     389                        if (str_lcmp(current_argv, long_options[i].name,
     390                            str_nlength(current_argv, current_argv_len)))
    391391                                continue;
    392392
  • uspace/lib/libc/generic/string.c

    r47a6708 r732bb0c  
    662662}
    663663
    664 int strncmp(const char *a, const char *b, size_t n)
    665 {
    666         size_t c = 0;
    667 
    668         while (c < n && a[c] && b[c] && (!(a[c] - b[c])))
    669                 c++;
    670        
    671         return ( c < n ? a[c] - b[c] : 0);
    672        
    673 }
    674 
    675664int stricmp(const char *a, const char *b)
    676665{
  • uspace/lib/libc/include/string.h

    r47a6708 r732bb0c  
    8787 */
    8888
    89 extern int strncmp(const char *, const char *, size_t);
    9089extern int stricmp(const char *, const char *);
    9190
Note: See TracChangeset for help on using the changeset viewer.