summaryrefslogtreecommitdiff
path: root/packages/gsm/files/fix-mlbuf.patch
diff options
context:
space:
mode:
authorMichael Lauer <mickey@vanille-media.de>2007-08-23 11:47:15 +0000
committerMichael Lauer <mickey@vanille-media.de>2007-08-23 11:47:15 +0000
commitf1d0d79f48ab191a1ed0b5065e39046e1d95fef4 (patch)
tree860036a8554d604726a256d7408c711df834b7cb /packages/gsm/files/fix-mlbuf.patch
parent2534c12ac4c879178132751e51db09c6e4f22cf9 (diff)
parent958b8822656bed6e5526f9441fea36570787f9c7 (diff)
merge of '88dd6a801655485b76bb6d591c1f763d51ff47b8'
and 'ea2a23cae4f4d939a07f699c39b603c4c2559ad1'
Diffstat (limited to 'packages/gsm/files/fix-mlbuf.patch')
-rw-r--r--packages/gsm/files/fix-mlbuf.patch50
1 files changed, 0 insertions, 50 deletions
diff --git a/packages/gsm/files/fix-mlbuf.patch b/packages/gsm/files/fix-mlbuf.patch
deleted file mode 100644
index ed4aa2519d..0000000000
--- a/packages/gsm/files/fix-mlbuf.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-Index: gsm/src/gsmd/atcmd.c
-===================================================================
---- gsm/src/gsmd/atcmd.c (revision 2745)
-+++ gsm/src/gsmd/atcmd.c (working copy)
-@@ -370,8 +370,8 @@
- if (g->mlbuf_len)
- g->mlbuf[g->mlbuf_len ++] = '\n';
- DEBUGP("Appending buf to mlbuf\n");
-- if (len > sizeof(g->mlbuf) - g->mlbuf_len)
-- len = sizeof(g->mlbuf) - g->mlbuf_len;
-+ if (len > MLPARSE_BUF_SIZE - g->mlbuf_len)
-+ len = MLPARSE_BUF_SIZE - g->mlbuf_len;
- memcpy(g->mlbuf + g->mlbuf_len, buf, len);
- g->mlbuf_len += len;
-
-@@ -470,7 +470,7 @@
- if (cr)
- len = cr - pos->cur;
- else
-- len = pos->buflen;
-+ len = pos->buflen - 1; /* assuming zero-terminated strings */
- rc = write(fd, pos->cur, len);
- if (rc == 0) {
- gsmd_log(GSMD_ERROR, "write returns 0, aborting\n");
-@@ -480,8 +480,8 @@
- fd, rc);
- return rc;
- }
-- if (cr && rc == len)
-- rc ++; /* Skip the \n */
-+ if (!cr || rc == len)
-+ rc ++; /* Skip the \n or \0 */
- pos->buflen -= rc;
- pos->cur += rc;
- write(fd, "\r", 1);
-Index: gsm/src/gsmd/gsmd.c
-===================================================================
---- gsm/src/gsmd/gsmd.c (revision 2745)
-+++ gsm/src/gsmd/gsmd.c (working copy)
-@@ -301,6 +301,10 @@
- {
- INIT_LLIST_HEAD(&g->users);
-
-+ g->mlbuf = talloc_array(gsmd_tallocs, unsigned char, MLPARSE_BUF_SIZE);
-+ if (!g->mlbuf)
-+ return -ENOMEM;
-+
- return 0;
- }
-