From 646515d288da8aec7dc266f7d30047320b271742 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Sun, 22 Dec 2013 01:23:17 +0100 Subject: rb: fix a dangerous comment we provided an example to show how to use rb_gets2 but did not NULL-terminate our array of delimiters. --- rb_str.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rb_str.h b/rb_str.h index f48d685..bbfef5e 100644 --- a/rb_str.h +++ b/rb_str.h @@ -26,7 +26,7 @@ char *rb_gets(t_rb *rb, const char *delim); * the longest will be discarded * * common use case: - * request = rb_gets(rb, (const char *[]){"\n", "\r", "\r\n"}) + * request = rb_gets(rb, (const char *[]){"\n", "\r", "\r\n", NULL}) * which will return a request disregarding whether netcat or telnet is used */ char *rb_gets2(t_rb *rb, const char *const *delim); -- cgit v1.2.3