Pārlūkot izejas kodu

Fix a couple of 'declaration after statement' errors.

Manuel Novoa III 21 gadi atpakaļ
vecāks
revīzija
edcbb2ecce
2 mainītis faili ar 2 papildinājumiem un 3 dzēšanām
  1. 1 2
      libc/misc/locale/locale.c
  2. 1 1
      libc/stdio/scanf.c

+ 1 - 2
libc/misc/locale/locale.c

@@ -1378,9 +1378,8 @@ __locale_t weak_const_function __curlocale(void)
 
 __locale_t weak_function __curlocale_set(__locale_t newloc)
 {
-	assert(newloc != LC_GLOBAL_LOCALE);
-
 	__locale_t oldloc = __curlocale_var;
+	assert(newloc != LC_GLOBAL_LOCALE);
 	__curlocale_var = newloc;
 	return oldloc;
 }

+ 1 - 1
libc/stdio/scanf.c

@@ -1119,8 +1119,8 @@ int VFSCANF (FILE *__restrict fp, const Wchar *__restrict format, va_list arg)
 	/* ANSI/ISO C99 requires format string to be a valid multibyte string
 	 * beginning and ending in its initial shift state. */
 	if (((__UCLIBC_CURLOCALE_DATA).encoding) != __ctype_encoding_7_bit) {
-		mbstate.mask = 0;		/* Initialize the mbstate. */
 		const char *p = format;
+		mbstate.mask = 0;		/* Initialize the mbstate. */
 		if (mbsrtowcs(NULL, &p, SIZE_MAX, &mbstate) == ((size_t)(-1))) {
 			__set_errno(EINVAL); /* Format string is invalid. */
 			return 0;