summaryrefslogtreecommitdiffstats
path: root/main/glib/strtolower.c
blob: 9a7dab21ff4b7ed508c2237bb95ab15464592f0c (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
24
25
26
27
28
29
30
31
32
33
#include "config.h"
#include <ctype.h>
#include "genlib.h"
#include "stddefs.h"

/* strtolower():
 *  In-place modification of a string to be all lower case.
 */
char *
strtolower(char *string)
{
    char *cp;

    cp = string;
    while(*cp) {
        *cp = tolower(*cp);
        cp++;
    }
    return(string);
}

char *
strtoupper(char *string)
{
    char *cp;

    cp = string;
    while(*cp) {
        *cp = toupper(*cp);
        cp++;
    }
    return(string);
}