Ignore:
Timestamp:
Jul 13, 2015, 3:10:27 PM (9 years ago)
Author:
guerin
Message:

string: implement strlen()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_libs/string.c

    r258 r607  
    3737}
    3838
     39///////////////////////////////////////////////////////////////////////////////////
     40// int strlen ( const char * str )
     41///////////////////////////////////////////////////////////////////////////////////
     42int strlen ( const char * str )
     43{
     44    const char *s = str;
     45
     46    while (*s)
     47        s++;
     48
     49    return (s - str);
     50}
     51
    3952// Local Variables:
    4053// tab-width: 4
Note: See TracChangeset for help on using the changeset viewer.