summaryrefslogtreecommitdiffstats
path: root/private/crt32/string/mips/strcpyt.c
blob: 4d0d99279987c9fcd73b72eee9f7c8d0b1b93381 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <stdio.h>
#include <limits.h>

#define SRCLEN 21   /* to avoid complicating errors */

void main( int argc, char **argv )
{
  int c;
  unsigned char *psrc, *pdst;      
  unsigned char src[SRCLEN] = "ABCDEFGHIJKLMNOPQRST";
  unsigned char dst[100];
  
    for (c = 'a'; c <= UCHAR_MAX; c++) {
        src[9] = c;
        strcpy( dst, src);
        for (psrc = src, pdst = dst; *psrc; psrc++, pdst++) {
            if (*psrc != *pdst) {
                printf("Fail - Could not find '%c' 0x%x in %s\n", c, c, src);
                break;
            }
        }
    }
}