From fbc0b497567fecd2818f4a497843f62d1be6d70c Mon Sep 17 00:00:00 2001 From: erin_yueh Date: Thu, 10 Jan 2008 05:14:53 +0000 Subject: gsmd: eliminate gcc warnings (Erin Yueh) git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@3807 99fdad57-331a-0410-800a-d7fa5415bdb3 --- src/gsmd/vendor_ti.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/gsmd/vendor_ti.c') diff --git a/src/gsmd/vendor_ti.c b/src/gsmd/vendor_ti.c index e34cbaf..219f23e 100644 --- a/src/gsmd/vendor_ti.c +++ b/src/gsmd/vendor_ti.c @@ -38,7 +38,7 @@ #include -static int csq_parse(char *buf, int len, const char *param, +static int csq_parse(const char *buf, int len, const char *param, struct gsmd *gsmd) { struct gsmd_evt_auxdata *aux; @@ -63,11 +63,13 @@ out_free_io: return -EIO; } -static int cpri_parse(char *buf, int len, const char *param, struct gsmd *gsmd) +static int cpri_parse(const char *buf, int len, const char *param, struct gsmd *gsmd) { char *tok1, *tok2; - - tok1 = strtok(buf, ","); + char tx_buf[20]; + + strcpy(tx_buf, buf); + tok1 = strtok(tx_buf, ","); if (!tok1) return -EIO; @@ -103,7 +105,7 @@ static int cpri_parse(char *buf, int len, const char *param, struct gsmd *gsmd) return 0; } -static int ctzv_parse(char *buf, int len, const char *param, struct gsmd *gsmd) +static int ctzv_parse(const char *buf, int len, const char *param, struct gsmd *gsmd) { /* FIXME: decide what to do with it. send as event to clients? or keep * locally? Offer option to sync system RTC? */ @@ -111,14 +113,16 @@ static int ctzv_parse(char *buf, int len, const char *param, struct gsmd *gsmd) } /* Call Progress Information */ -static int cpi_parse(char *buf, int len, const char *param, struct gsmd *gsmd) +static int cpi_parse(const char *buf, int len, const char *param, struct gsmd *gsmd) { char *tok; struct gsmd_evt_auxdata *aux; struct gsmd_ucmd *ucmd = usock_build_event(GSMD_MSG_EVENT, GSMD_EVT_OUT_STATUS, sizeof(*aux)); - + char tx_buf[64]; + + strcpy(tx_buf, buf); DEBUGP("entering cpi_parse param=`%s'\n", param); if (!ucmd) return -EINVAL; @@ -128,7 +132,7 @@ static int cpi_parse(char *buf, int len, const char *param, struct gsmd *gsmd) /* Format: cId, msgType, ibt, tch, dir,[mode],[number],[type],[alpha],[cause],line */ /* call ID */ - tok = strtok(buf, ","); + tok = strtok(tx_buf, ","); if (!tok) goto out_free_io; -- cgit v1.2.3