diff options
author | Philipp Zabel <philipp.zabel@gmail.com> | 2007-08-23 08:33:32 +0000 |
---|---|---|
committer | Philipp Zabel <philipp.zabel@gmail.com> | 2007-08-23 08:33:32 +0000 |
commit | 366a376daf8a57a863ea9fed1d0ca9f9a899da7f (patch) | |
tree | d1751e4a28046e3df35546fd14727a4afc744778 /packages/gsm/files/fix-mlbuf.patch | |
parent | 0f600231b5e6028cde94417ae7e4dc27a12d362e (diff) | |
parent | 1363271963ccfde056a039cd3db6c7b20afb0055 (diff) |
merge of '3a4584bc4628ec0badfbd77badf7bbaaff7bfb93'
and '52b1e168dedcb5e20f1e063682ea6e64af003ffe'
Diffstat (limited to 'packages/gsm/files/fix-mlbuf.patch')
-rw-r--r-- | packages/gsm/files/fix-mlbuf.patch | 50 |
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; - } - |