summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/regress/lib/libc/regex/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/regress/lib/libc/regex/main.c b/src/regress/lib/libc/regex/main.c
index 92257a7179..73334fa4ce 100644
--- a/src/regress/lib/libc/regex/main.c
+++ b/src/regress/lib/libc/regex/main.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: main.c,v 1.8 2016/05/26 13:33:53 schwarze Exp $ */ 1/* $OpenBSD: main.c,v 1.9 2016/05/26 14:17:58 schwarze Exp $ */
2/* $NetBSD: main.c,v 1.2 1995/04/20 22:39:51 cgd Exp $ */ 2/* $NetBSD: main.c,v 1.2 1995/04/20 22:39:51 cgd Exp $ */
3 3
4#include <stdio.h> 4#include <stdio.h>
@@ -454,7 +454,6 @@ char *should;
454 } 454 }
455 455
456 len = (int)(sub.rm_eo - sub.rm_so); 456 len = (int)(sub.rm_eo - sub.rm_so);
457 shlen = (int)strlen(should);
458 p = str + sub.rm_so; 457 p = str + sub.rm_so;
459 458
460 /* check for not supposed to match */ 459 /* check for not supposed to match */
@@ -464,6 +463,7 @@ char *should;
464 } 463 }
465 464
466 /* check for wrong match */ 465 /* check for wrong match */
466 shlen = (int)strlen(should);
467 if (len != shlen || strncmp(p, should, (size_t)shlen) != 0) { 467 if (len != shlen || strncmp(p, should, (size_t)shlen) != 0) {
468 snprintf(grump, sizeof grump, "matched `%.*s' instead", len, p); 468 snprintf(grump, sizeof grump, "matched `%.*s' instead", len, p);
469 return(grump); 469 return(grump);