public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/5] docparse/docparse: Warn on truncated docstring
Date: Wed, 16 Dec 2020 11:10:08 +0100	[thread overview]
Message-ID: <20201216101012.14644-2-chrubis@suse.cz> (raw)
In-Reply-To: <20201216101012.14644-1-chrubis@suse.cz>

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
 docparse/docparse.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/docparse/docparse.c b/docparse/docparse.c
index 22c5c6f2c..702820757 100644
--- a/docparse/docparse.c
+++ b/docparse/docparse.c
@@ -12,6 +12,8 @@
 
 #include "data_storage.h"
 
+#define WARN(str) fprintf(stderr, "WARNING: " str "\n")
+
 static void oneline_comment(FILE *f)
 {
 	int c;
@@ -52,7 +54,8 @@ static void multiline_comment(FILE *f, struct data_node *doc)
 				struct data_node *line;
 				buf[bufp] = 0;
 				line = data_node_string(eat_asterisk_space(buf));
-				data_node_array_add(doc, line);
+				if (data_node_array_add(doc, line))
+					WARN("doc string comment truncated");
 				bufp = 0;
 				continue;
 			}
@@ -194,8 +197,6 @@ exit:
 	return buf;
 }
 
-#define WARN(str) fprintf(stderr, str "\n")
-
 static int parse_array(FILE *f, struct data_node *node)
 {
 	const char *token;
-- 
2.26.2


  reply	other threads:[~2020-12-16 10:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-16 10:10 [LTP] [PATCH 0/5] Small docparser fixes Cyril Hrubis
2020-12-16 10:10 ` Cyril Hrubis [this message]
2020-12-17 15:34   ` [LTP] [PATCH 1/5] docparse/docparse: Warn on truncated docstring Petr Vorel
2020-12-16 10:10 ` [LTP] [PATCH 2/5] doc_parse/data_storage: Bump the array max size Cyril Hrubis
2020-12-17 15:35   ` Petr Vorel
2020-12-16 10:10 ` [LTP] [PATCH 3/5] docparse/docparse: Eat only first whitespace for comment block Cyril Hrubis
2020-12-17 15:39   ` Petr Vorel
2020-12-16 10:10 ` [LTP] [PATCH 4/5] syscalls/abort: Remove second space before description text Cyril Hrubis
2020-12-17 15:40   ` Petr Vorel
2020-12-16 10:10 ` [LTP] [PATCH 5/5] syscalls/move_pages12: Add one more kernel git hash Cyril Hrubis
2020-12-17 15:42   ` Petr Vorel
2021-01-05 13:08     ` Cyril Hrubis
2021-01-05 18:16       ` Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201216101012.14644-2-chrubis@suse.cz \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox