summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--roff.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/roff.c b/roff.c
index 0d8a1c5b..259817d2 100644
--- a/roff.c
+++ b/roff.c
@@ -1519,11 +1519,12 @@ roff_getstrn(const struct roff *r, const char *name, size_t len)
{
const struct roffstr *n;
- n = r->first_string;
- while (n && (strncmp(name, n->name, len) || '\0' != n->name[(int)len]))
- n = n->next;
+ for (n = r->first_string; n; n = n->next)
+ if (0 == strncmp(name, n->name, len) &&
+ '\0' == n->name[(int)len])
+ return(n->string);
- return(n ? n->string : NULL);
+ return(NULL);
}
static void