summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlaforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3>2007-05-01 23:39:49 +0000
committerlaforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3>2007-05-01 23:39:49 +0000
commit4a965b6b43225b0b4cd4f258a31e2d3db85f4193 (patch)
tree0b8748503c98040bde04faa8073f786064cbb29b /src
parenta9ecb7221542a299f4659d0c8d57d03a26523e0b (diff)
make CLIP/COLP numbers zero-terminated (Closes: #525)
git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@1892 99fdad57-331a-0410-800a-d7fa5415bdb3
Diffstat (limited to 'src')
-rw-r--r--src/gsmd/unsolicited.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gsmd/unsolicited.c b/src/gsmd/unsolicited.c
index 251f4ed..b9bd97f 100644
--- a/src/gsmd/unsolicited.c
+++ b/src/gsmd/unsolicited.c
@@ -254,7 +254,8 @@ static int clip_parse(char *buf, int len, const char *param,
if (comma - param > GSMD_ADDR_MAXLEN)
return -EINVAL;
- memcpy(aux->u.clip.addr.number, param, comma-param);
+ aux->u.clip.addr.number[0] = '\0';
+ strncat(aux->u.clip.addr.number, param, comma-param);
/* FIXME: parse of subaddr, etc. */
return usock_evt_send(gsmd, ucmd, GSMD_EVT_IN_CLIP);
@@ -280,7 +281,8 @@ static int colp_parse(char *buf, int len, const char *param,
if (comma - param > GSMD_ADDR_MAXLEN)
return -EINVAL;
- memcpy(aux->u.colp.addr.number, param, comma-param);
+ aux->u.colp.addr.number[0] = '\0';
+ strncat(aux->u.colp.addr.number, param, comma-param);
/* FIXME: parse of subaddr, etc. */
return usock_evt_send(gsmd, ucmd, GSMD_EVT_OUT_COLP);
personal git repositories of Harald Welte. Your mileage may vary