lkml.org 
[lkml]   [2019]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH v1 5/6] lib: scanf: mark sscanf and vsscanf as __must_check
From
Date
Caller must check returned count of matched arguments.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
---
include/linux/kernel.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 32726b25eaa5..3142a456f00b 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -483,9 +483,9 @@ const char *kvasprintf_const(gfp_t gfp, const char *fmt, va_list args);
#define SCANF_MORE (1 << 30)

extern __scanf(2, 3)
-int sscanf(const char *, const char *, ...);
+int __must_check sscanf(const char *, const char *, ...);
extern __scanf(2, 0)
-int vsscanf(const char *, const char *, va_list);
+int __must_check vsscanf(const char *, const char *, va_list);

extern int get_option(char **str, int *pint);
extern char *get_options(const char *str, int nints, int *ints);
\
 
 \ /
  Last update: 2019-03-10 17:57    [W:0.075 / U:2.904 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site