X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftinfo%2Fcaptoinfo.c;h=de0133b386c6b50fbafdc7ad07a493ea84b7631f;hp=9362105ab795ebd4192e812737ca1e798e0eece9;hb=d61c3c6a831d18ef0ed6f797ac97d60fffc2f158;hpb=04d942c3d98cf0a929c6afb17be8c10d4ae39af0 diff --git a/ncurses/tinfo/captoinfo.c b/ncurses/tinfo/captoinfo.c index 9362105a..de0133b3 100644 --- a/ncurses/tinfo/captoinfo.c +++ b/ncurses/tinfo/captoinfo.c @@ -98,7 +98,7 @@ #include #include -MODULE_ID("$Id: captoinfo.c,v 1.99 2020/05/25 21:28:29 tom Exp $") +MODULE_ID("$Id: captoinfo.c,v 1.100 2020/07/08 21:39:54 tom Exp $") #if 0 #define DEBUG_THIS(p) DEBUG(9, p) @@ -639,7 +639,7 @@ _nc_infotocap(const char *cap GCC_UNUSED, const char *str, int const parameteriz /* we may have to move some trailing mandatory padding up front */ padding = str + strlen(str) - 1; if (padding > str && *padding == '>') { - if (*--padding == '/') + if (padding > (str + 1) && *--padding == '/') --padding; while (isdigit(UChar(*padding)) || *padding == '.' || *padding == '*') padding--;