diff options
author | kpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2008-01-11 20:22:28 +0000 |
---|---|---|
committer | kpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2008-01-11 20:22:28 +0000 |
commit | 20ab3793932e40ff48dcc0c0320f91ffe42ff4ed (patch) | |
tree | 35e2834bade82655c27ca6c186088030a1f14c11 /mg2ec.h | |
parent | 44e930fd09617e6caddf9f86aef608384a5d8f6f (diff) |
apparently strcasecmp() is a fairly recent addition to the kernel, so use the older method of forcing the string to lowercase and using strcmp() instead for parameter parsing
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@3662 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'mg2ec.h')
-rw-r--r-- | mg2ec.h | 18 |
1 files changed, 6 insertions, 12 deletions
@@ -26,21 +26,12 @@ #ifndef _MG2_ECHO_H #define _MG2_ECHO_H -#ifdef __KERNEL__ #include <linux/kernel.h> #include <linux/slab.h> +#include <linux/ctype.h> + #define MALLOC(a) kmalloc((a), GFP_KERNEL) #define FREE(a) kfree(a) -#else -#include <stdlib.h> -#include <unistd.h> -#include <stdint.h> -#include <string.h> -#include <math.h> -#define MALLOC(a) malloc(a) -#define FREE(a) free(a) -#endif - #define ABS(a) abs(a!=-32768?a:-32767) @@ -658,6 +649,7 @@ static int echo_can_create(struct zt_echocanparams *ecp, struct zt_echocanparam int maxu; size_t size; unsigned int x; + char *c; maxy = ecp->tap_length + DEFAULT_M; maxu = DEFAULT_M; @@ -688,7 +680,9 @@ static int echo_can_create(struct zt_echocanparams *ecp, struct zt_echocanparam #endif for (x = 0; x < ecp->param_count; x++) { - if (!strcasecmp(p[x].name, "aggressive")) { + for (c = p[x].name; *c; c++) + *c = tolower(*c); + if (!strcmp(p[x].name, "aggressive")) { (*ec)->aggressive = p[x].value ? 1 : 0; } else { printk(KERN_WARNING "Unknown parameter supplied to MG2 echo canceler: '%s'\n", p[x].name); |