increase buffer size, separate @username with spaces - tscrape - twitter scraper
(HTM) git clone git://git.codemadness.org/tscrape
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit b4bc9e6b47df5b9eb612f069c20463a924d6a55e
(DIR) parent f92f2d068c213425f073d830a1dd8b86126168a5
(HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 11 Aug 2017 15:46:57 +0200
increase buffer size, separate @username with spaces
Diffstat:
M tscrape.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
---
(DIR) diff --git a/tscrape.c b/tscrape.c
@@ -38,10 +38,10 @@ size_t strlcat(char *, const char *, size_t);
size_t strlcpy(char *, const char *, size_t);
/* data */
-static char fullname[128];
+static char fullname[1024];
static char timestamp[16];
-static char text[1024];
-static char username[128];
+static char text[4096];
+static char username[1024];
static char classname[256];
static char datatime[16];
@@ -226,12 +226,16 @@ xmlattrentity(XMLParser *x, const char *t, size_t tl, const char *a, size_t al,
static void
xmldata(XMLParser *x, const char *d, size_t dl)
{
- if (state & Username)
+ if (state & Username) {
+ if (d[0] == '@')
+ strlcat(username, " ", sizeof(username));
strlcat(username, d, sizeof(username));
- else if (state & Fullname)
+ } else if (state & Fullname) {
+ strlcat(fullname, " ", sizeof(fullname));
strlcat(fullname, d, sizeof(fullname));
- else if (state & Text)
+ } else if (state & Text) {
strlcat(text, d, sizeof(text));
+ }
}
static void