1 /*-------------- Telecommunications & Signal Processing Lab ---------------
2 McGill University
3
4 Routine:
5 int STstrLC (const char Si[], char So[])
6
7 Purpose:
8 Copy a string, changing uppercase characters to lowercase
9
10 Description:
11 This routine changes uppercase characters to lowercase.
12
13 Parameters:
14 <- int STstrLC
15 Number of characters in the output string
16 -> const char Si[]
17 Input character string
18 <- char So[]
19 Output character string. This string should provide for at least as many
20 characters as the input string. This routine accepts Si = So, in which
21 case the output string overlays the input string.
22
23 Author / revision:
24 P. Kabal Copyright (C) 2003
25 $Revision: 1.2 $ $Date: 2003/05/09 03:02:44 $
26
27 -------------------------------------------------------------------------*/
28
29 #include <ctype.h>
30
31 #include <libtsp.h>
32
33
34 int
STstrLC(const char Si[],char So[])35 STstrLC (const char Si[], char So[])
36
37 {
38 int nc;
39
40 for (nc = 0; Si[nc] != '\0'; ++nc)
41 So[nc] = tolower ((unsigned const char) Si[nc]);
42
43 So[nc] = '\0';
44
45 return nc;
46 }
47