From b98f102a0745464bfe54b349c9260d63fd9d39b5 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Wed, 3 Mar 2021 07:47:44 -0700 Subject: [PATCH] locale.c: Add some asserts --- locale.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/locale.c b/locale.c index b53b17daabf2..69883526fa2f 100644 --- a/locale.c +++ b/locale.c @@ -702,6 +702,7 @@ S_my_querylocale_i(pTHX_ const unsigned int index) DEBUG_Lv(PerlIO_printf(Perl_debug_log, "my_querylocale_i(%s) returning '%s'\n", category_names[index], retval)); + assert(strNE(retval, "")); return retval; } @@ -2645,6 +2646,7 @@ Perl_setlocale(const int category, const char * locale) /* Here, an actual change is being requested. Do it */ retval = setlocale_i(cat_index, locale); + assert(retval == NULL || strNE(retval, "")); if (! retval) { DEBUG_L(PerlIO_printf(Perl_debug_log, @@ -2671,6 +2673,7 @@ Perl_setlocale(const int category, const char * locale) DEBUG_L(PerlIO_printf(Perl_debug_log, "returning '%s'\n", retval)); + assert(strNE(retval, "")); return retval; #endif @@ -3923,6 +3926,7 @@ S_my_langinfo_i(pTHX_ switch (item) { default: + assert(item < 0); /* Make sure using perl_langinfo.h */ return ""; case RADIXCHAR: