From e376719b727dea88c81ad2111769ab8a596c6f84 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 11 Dec 2013 14:54:22 -0600 Subject: libc logic should not directly assign errno, but should use set_errno() macro. This is because in the kernel build, errno is a system call --- nuttx/libc/stdio/lib_sscanf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'nuttx/libc/stdio') diff --git a/nuttx/libc/stdio/lib_sscanf.c b/nuttx/libc/stdio/lib_sscanf.c index b4c7ef9fe..00d4b71f6 100644 --- a/nuttx/libc/stdio/lib_sscanf.c +++ b/nuttx/libc/stdio/lib_sscanf.c @@ -446,7 +446,7 @@ int vsscanf(FAR const char *buf, FAR const char *fmt, va_list ap) long tmplong; errsave = errno; - errno = 0; + set_errno(0); tmplong = strtol(tmp, &endptr, base); /* Number can't be converted */ @@ -456,7 +456,7 @@ int vsscanf(FAR const char *buf, FAR const char *fmt, va_list ap) return count; } - errno = errsave; + set_errno(errno); /* We have to check whether we need to return a long * or an int. @@ -556,7 +556,7 @@ int vsscanf(FAR const char *buf, FAR const char *fmt, va_list ap) double_t dvalue; errsave = errno; - errno = 0; + set_errno(0); dvalue = strtod(tmp, &endptr); /* Number can't be converted */ @@ -566,7 +566,7 @@ int vsscanf(FAR const char *buf, FAR const char *fmt, va_list ap) return count; } - errno = errsave; + set_errno(errsave); /* We have to check whether we need to return a float * or a double. -- cgit v1.2.3