commit | 039b0a7c37a0916adffbc1a5447dc6796b309cbf | [log] [tgz] |
---|---|---|
author | Olaf Hering <olh@suse.de> | Fri Jan 21 19:51:36 2005 +0000 |
committer | H. Peter Anvin <hpa@zytor.com> | Fri Jan 21 19:51:36 2005 +0000 |
tree | f5d368d1bafdcdcfd1e725e0e55eb9bb8bb2969b | |
parent | 51d7fe38246ef1e99f0a8f847d6f3f33786bb580 [diff] |
The klibc strncat doesnt behave like described in the man page. It doesnt terminate the string if size < strlen(src). It doesnt make dst longer than size. #include <string.h> #include <stdio.h> int main(void) { unsigned char olh[42]; memset(olh, 'A', sizeof(olh)); sprintf(olh, "abc"); fprintf(stderr, "olh: '%s'\n", olh); bar(olh, "123456789", 7); fprintf(stderr, "olh: '%s'\n", olh); return 0; } olh: 'abc' olh: 'abc1234AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'