From acf88c6fa8955ea061f865c2844cb43de6b3510e Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 16 Oct 1997 15:03:54 +0000 Subject: [PATCH] add assertions --- src/sort.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sort.c b/src/sort.c index 5b4b46808b..54e39b72c0 100644 --- a/src/sort.c +++ b/src/sort.c @@ -541,6 +541,8 @@ strncoll (unsigned char *s1, unsigned char *s2, int len) { register int diff; + assert (len == min (strlen (s1), strlen (s2))); + if (need_locale) { /* Emulate a strncoll function, by forcing strcoll to compare @@ -569,6 +571,7 @@ strncoll_s2_readonly (unsigned char *s1, const unsigned char *s2, int len) { register int diff; + assert (len == strlen (s2)); assert (len <= strlen (s1)); if (need_locale) -- 2.47.3