[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Lynx-dev] [bug, minor] page navigation too short string

From: Valentin Nechayev
Subject: [Lynx-dev] [bug, minor] page navigation too short string
Date: Wed, 27 Jul 2016 08:21:12 +0300

to navigate to a known page number, one should press "0" "<number>p".
At 32-bit systems, this doesn't allow entering more than 4 characters,
so, "999p" is allowed, but "1000p" is not, if refuses additional
characters after "1000".

In LYGetFile.c, this is in the row

    if (LYgetBString(&temp, FALSE, sizeof(temp), NORECALL) < 0 ||

where sizeof(temp) seems result of usage misconception because
LYgetBString() wants here a maximal input line size.

Just for me I've trivially fixed this with a magic constant:

--- src/LYGetFile.c
+++ src/LYGetFile.c
@@ -1141,7 +1141,7 @@
      * Get the number, possibly with a letter suffix, from the user.
-    if (LYgetBString(&temp, FALSE, sizeof(temp), NORECALL) < 0 ||
+    if (LYgetBString(&temp, FALSE, 11, NORECALL) < 0 ||
        isBEmpty(temp)) {
        return (DO_NOTHING);

(11 is maximal length of unsigned int in text, plus "p")
but one could have more advanced idea.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]