]>
cvs.zerfleddert.de Git - proxmark3-svn/blob - armsrc/string.c
1 //-----------------------------------------------------------------------------
2 // Jonathan Westhues, Sept 2005
4 // This code is licensed to you under the terms of the GNU GPL, version 2 or,
5 // at your option, any later version. See the LICENSE.txt file for the text of
7 //-----------------------------------------------------------------------------
8 // Common string.h functions
9 //-----------------------------------------------------------------------------
14 void *memcpy(void *dest
, const void *src
, int len
)
17 const uint8_t *s
= src
;
26 void *memset(void *dest
, int c
, int len
)
36 int memcmp(const void *av
, const void *bv
, int len
)
38 const uint8_t *a
= av
;
39 const uint8_t *b
= bv
;
51 int strlen(const char *str
)
61 char* strncat(char *dest
, const char *src
, unsigned int n
)
63 unsigned int dest_len
= strlen(dest
);
66 for (i
= 0 ; i
< n
&& src
[i
] != '\0' ; i
++)
67 dest
[dest_len
+ i
] = src
[i
];
68 dest
[dest_len
+ i
] = '\0';