Changeset bd1deed in mainline for kernel/generic/src/lib/memstr.c


Ignore:
Timestamp:
2007-02-11T20:04:08Z (18 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c993e45
Parents:
ce8aed1
Message:

experimental support for Objective C
(disabled by default)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/lib/memstr.c

    rce8aed1 rbd1deed  
    7575        }
    7676               
    77         return (char *)src;
     77        return (char *) src;
    7878}
    7979
     
    9393        uint8_t *p = (uint8_t *) dst;
    9494       
    95         for(i=0; i<cnt; i++)
     95        for (i = 0; i < cnt; i++)
    9696                p[i] = x;
    9797}
     
    112112        uint16_t *p = (uint16_t *) dst;
    113113       
    114         for(i=0; i<cnt; i++)
     114        for (i = 0; i < cnt; i++)
    115115                p[i] = x;       
     116}
     117
     118/** Copy string
     119 *
     120 * Copy string from src address to dst address.
     121 * The copying is done char-by-char until the null
     122 * character. The source and destination memory areas
     123 * cannot overlap.
     124 *
     125 * @param src Origin string to copy from.
     126 * @param dst Origin string to copy to.
     127 *
     128 */
     129char *strcpy(char *dest, const char *src)
     130{
     131        char *orig = dest;
     132       
     133        while ((*(dest++) = *(src++)));
     134        return orig;
    116135}
    117136
Note: See TracChangeset for help on using the changeset viewer.