Lowercase user/device (reported by tiptronic)

This commit is contained in:
Jan-Piet Mens
2015-09-16 15:30:28 +02:00
parent fe53ecc6d4
commit 62f603f33f
4 changed files with 14 additions and 10 deletions
-10
View File
@@ -37,16 +37,6 @@
#ifdef HAVE_HTTP
static void lowercase(char *s)
{
char *bp;
for (bp = s; bp && *bp; bp++) {
if (isupper(*bp))
*bp = tolower(*bp);
}
}
/*
* Return a lowercased copy of a GET/POST parameter or NULL. The parameter
* may be overriden by an HTTP header called X-Limit-<fieldname>.
+3
View File
@@ -488,6 +488,9 @@ int main(int argc, char **argv)
return (0);
}
lowercase(username);
lowercase(device);
if (!username && device) {
fprintf(stderr, "%s: device name without username doesn't make sense\n", progname);
return (-2);
+10
View File
@@ -540,3 +540,13 @@ int geohash_prec(void)
{
return (_precision);
}
void lowercase(char *s)
{
char *bp;
for (bp = s; bp && *bp; bp++) {
if (isupper(*bp))
*bp = tolower(*bp);
}
}
+1
View File
@@ -29,5 +29,6 @@ int safewrite(char *filename, char *buf);
void olog(int level, char *fmt, ...);
void geohash_setprec(int precision);
int geohash_prec(void);
void lowercase(char *s);
#endif