Commit 713f18e9 authored by Karsten Keil's avatar Karsten Keil Committed by Nathan Scott

[PATCH] ISDN strpbrk fix

Here is a small ISDN fix for the current tree.

There is a compiler inlining/optimation problem with strpbrk, if it has
only a one character search string.  This results in a missing strchr
because the compiler internally replace strpbrk with strchr in this
case, but did so after inline handling stage.
parent bf61d128
...@@ -504,19 +504,19 @@ icn_parse_status(u_char * status, int channel, icn_card * card) ...@@ -504,19 +504,19 @@ icn_parse_status(u_char * status, int channel, icn_card * card)
case 3: case 3:
{ {
char *t = status + 6; char *t = status + 6;
char *s = strpbrk(t, ","); char *s = strchr(t, ',');
*s++ = '\0'; *s++ = '\0';
strlcpy(cmd.parm.setup.phone, t, strlcpy(cmd.parm.setup.phone, t,
sizeof(cmd.parm.setup.phone)); sizeof(cmd.parm.setup.phone));
s = strpbrk(t = s, ","); s = strchr(t = s, ',');
*s++ = '\0'; *s++ = '\0';
if (!strlen(t)) if (!strlen(t))
cmd.parm.setup.si1 = 0; cmd.parm.setup.si1 = 0;
else else
cmd.parm.setup.si1 = cmd.parm.setup.si1 =
simple_strtoul(t, NULL, 10); simple_strtoul(t, NULL, 10);
s = strpbrk(t = s, ","); s = strchr(t = s, ',');
*s++ = '\0'; *s++ = '\0';
if (!strlen(t)) if (!strlen(t))
cmd.parm.setup.si2 = 0; cmd.parm.setup.si2 = 0;
......
...@@ -122,17 +122,17 @@ static void ...@@ -122,17 +122,17 @@ static void
isdnloop_parse_setup(char *setup, isdn_ctrl * cmd) isdnloop_parse_setup(char *setup, isdn_ctrl * cmd)
{ {
char *t = setup; char *t = setup;
char *s = strpbrk(t, ","); char *s = strchr(t, ',');
*s++ = '\0'; *s++ = '\0';
strlcpy(cmd->parm.setup.phone, t, sizeof(cmd->parm.setup.phone)); strlcpy(cmd->parm.setup.phone, t, sizeof(cmd->parm.setup.phone));
s = strpbrk(t = s, ","); s = strchr(t = s, ',');
*s++ = '\0'; *s++ = '\0';
if (!strlen(t)) if (!strlen(t))
cmd->parm.setup.si1 = 0; cmd->parm.setup.si1 = 0;
else else
cmd->parm.setup.si1 = simple_strtoul(t, NULL, 10); cmd->parm.setup.si1 = simple_strtoul(t, NULL, 10);
s = strpbrk(t = s, ","); s = strchr(t = s, ',');
*s++ = '\0'; *s++ = '\0';
if (!strlen(t)) if (!strlen(t))
cmd->parm.setup.si2 = 0; cmd->parm.setup.si2 = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment