Rev 2640 | Rev 2787 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2640 | Rev 2754 | ||
---|---|---|---|
Line 326... | Line 326... | ||
326 | 326 | ||
327 | char *strcpy(char *dest, const char *src) |
327 | char *strcpy(char *dest, const char *src) |
328 | { |
328 | { |
329 | char *orig = dest; |
329 | char *orig = dest; |
330 | 330 | ||
331 | while ((*(dest++) = *(src++))); |
331 | while ((*(dest++) = *(src++))) |
- | 332 | ; |
|
332 | return orig; |
333 | return orig; |
333 | } |
334 | } |
334 | 335 | ||
335 | char *strncpy(char *dest, const char *src, size_t n) |
336 | char *strncpy(char *dest, const char *src, size_t n) |
336 | { |
337 | { |
337 | char *orig = dest; |
338 | char *orig = dest; |
338 | 339 | ||
339 | while ((*(dest++) = *(src++)) && --n); |
340 | while ((*(dest++) = *(src++)) && --n) |
- | 341 | ; |
|
- | 342 | return orig; |
|
- | 343 | } |
|
- | 344 | ||
- | 345 | char *strcat(char *dest, const char *src) |
|
- | 346 | { |
|
- | 347 | char *orig = dest; |
|
- | 348 | while (*dest++) |
|
- | 349 | ; |
|
- | 350 | --dest; |
|
- | 351 | while ((*dest++ = *src++)) |
|
- | 352 | ; |
|
340 | return orig; |
353 | return orig; |
341 | } |
354 | } |
342 | 355 | ||
343 | /** @} |
356 | /** @} |
344 | */ |
357 | */ |