aboutsummaryrefslogtreecommitdiff
path: root/blaze822.c
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-07-25 13:10:35 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-07-25 13:10:35 +0200
commit182a32ff9dc06805995248a8ed09e4fcf0f46c2c (patch)
treeff142254d249c2cc6dcaa34bc2bb3be340486274 /blaze822.c
parente747879e0ea46fdfb748a90b91ac11cd16dca7f5 (diff)
downloadmblaze-182a32ff9dc06805995248a8ed09e4fcf0f46c2c.tar.gz
blaze822: blaze822_addr: return 0 when no address is found
Also return null pointers instead of empty strings.
Diffstat (limited to 'blaze822.c')
-rw-r--r--blaze822.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/blaze822.c b/blaze822.c
index 1011d29..4feddfc 100644
--- a/blaze822.c
+++ b/blaze822.c
@@ -146,14 +146,16 @@ blaze822_addr(char *s, char **dispo, char **addro)
{
static char disp[1024];
static char addr[1024];
-// char *disp = disp+sizeof disp;
-// char *addr = addr+sizeof addr;
char *c, *e;
-// printf("RAW : |%s|\n", s);
-
while (iswsp(*s))
s++;
+
+ if (!*s) {
+ if (dispo) *dispo = 0;
+ if (addro) *addro = 0;
+ return 0;
+ }
c = disp;
e = disp + sizeof disp;
@@ -213,11 +215,8 @@ blaze822_addr(char *s, char **dispo, char **addro)
*disp = 0;
}
-// printf("DISP :: |%s|\n", disp);
-// printf("ADDR :: |%s|\n", addr);
-
- if (dispo) *dispo = disp;
- if (addro) *addro = addr;
+ if (dispo) *dispo = *disp ? disp : 0;
+ if (addro) *addro = *addr ? addr : 0;
return s;
}