Răsfoiți Sursa

* Fixed a few fatal bugs in showhelp()

svn: 483
Bryan Drewery 22 ani în urmă
părinte
comite
d07eedf3c5
2 a modificat fișierele cu 53 adăugiri și 53 ștergeri
  1. 38 38
      misc/help.txt
  2. 15 15
      src/misc.c

+ 38 - 38
misc/help.txt

@@ -18,7 +18,7 @@ See also: -chan, chanset, chaninfo
    Adds an empty channel record for the specified user so that channel lastons
    Adds an empty channel record for the specified user so that channel lastons
    and info lines can be saved. No flags are associated with the channel.
    and info lines can be saved. No flags are associated with the channel.
  
  
-See also: -chrec, chattr%{+n}, +chan, -chan
+See also: -chrec, chattr%{+n}, +chan, -chan%{-}
 ::+exempt
 ::+exempt
 ###  %b+exempt%b <hostmask> [channel] [%%<XdXhXm>] [comment]
 ###  %b+exempt%b <hostmask> [channel] [%%<XdXhXm>] [comment]
    Adds an exempt to the list of exempts stored on the bot, with optional
    Adds an exempt to the list of exempts stored on the bot, with optional
@@ -59,7 +59,7 @@ See also: -noteign noteigns
    Creates a new user record for the handle given. The new user record will
    Creates a new user record for the handle given. The new user record will
    have no flags, an optional hostmask, and a random pass/secpass.
    have no flags, an optional hostmask, and a random pass/secpass.
  
  
-See also: -user, +host, -host%{+ni}, newleaf
+See also: -user, +host, -host%{+ni}, newleaf%{-}
 ::-ban
 ::-ban
 ###  %b-ban%b <banmask or number> [channel]
 ###  %b-ban%b <banmask or number> [channel]
    Removes the specified ban from the list of bans stored on the bot. You may
    Removes the specified ban from the list of bans stored on the bot. You may
@@ -71,7 +71,7 @@ See also: bans, +ban, stick, unstick
    This is exactly the same as %b'%d-user'%b (it removes a user record). It is
    This is exactly the same as %b'%d-user'%b (it removes a user record). It is
    included for convenience.
    included for convenience.
  
  
-See also: +user, -user%{+n}, newleaf
+See also: +user, -user%{+n}, newleaf%{-}
 ::-chan
 ::-chan
 ### %b-chan%b <channel>
 ### %b-chan%b <channel>
      This removes ALL information about a channel from the bot. 
      This removes ALL information about a channel from the bot. 
@@ -129,7 +129,7 @@ See also: +noteign noteigns
 ###  %b-user%b <handle>
 ###  %b-user%b <handle>
    Removes the specified handle's user record.
    Removes the specified handle's user record.
  
  
-See also: +user%{+ai}, -bot%{+n}, newleaf
+See also: +user%{+ai}, -bot%{-}%{+nai}, newleaf%{-}
 ::about:
 ::about:
 ###  %babout%b
 ###  %babout%b
    If you feel you are missing from the list feel free to contact bryan.
    If you feel you are missing from the list feel free to contact bryan.
@@ -286,7 +286,7 @@ See also: botconfig
    eventually send you one line containing its version, network setting,
    eventually send you one line containing its version, network setting,
    channels, and uptime.
    channels, and uptime.
  
  
-See also: %{+n}bottree, vbottree%{+m}, bots
+See also: %{+n}bottree, vbottree%{-}%{+m}, bots%{-}
 ::botjump:
 ::botjump:
 ###  %bbotjump%b <bot> [server [port [pass]]]
 ###  %bbotjump%b <bot> [server [port [pass]]]
    Makes the bot jump to another server. If you don't specify a
    Makes the bot jump to another server. If you don't specify a
@@ -302,7 +302,7 @@ See also: jump, servers, botserver
    sends a private message to someone from the bot, just as if the
    sends a private message to someone from the bot, just as if the
    bot had typed /msg.
    bot had typed /msg.
  
  
-See also: msg%{+n}, netmsg
+See also: msg%{+n}, netmsg%{-}
 ::botnick:
 ::botnick:
 ###  %bbotnick%b <bot>
 ###  %bbotnick%b <bot>
    The bot will display it's current nick over DCC.
    The bot will display it's current nick over DCC.
@@ -321,7 +321,7 @@ See also: downbots%{+n}, bottree, vbottree%{-}, botinfo
 ###  %bbotserver%b <bot>
 ###  %bbotserver%b <bot>
    The bot will display it's current server and lag over DCC.
    The bot will display it's current server and lag over DCC.
  
  
-See also: netserver, servers%{+n}, config
+See also: netserver, servers%{+n}, config%{-}
 :hub:bottree
 :hub:bottree
 ###  %bbottree%b
 ###  %bbottree%b
    Shows a tree-format diagram of the bots currently on the botnet. It's just a
    Shows a tree-format diagram of the bots currently on the botnet. It's just a
@@ -333,7 +333,7 @@ See also: bots, downbots, botinfo, vbottree
 ###  %bbotversion%b <bot>
 ###  %bbotversion%b <bot>
    The bot will display it's pack version and uname.
    The bot will display it's pack version and uname.
  
  
-See also: netversion, about%{+m|m}, status
+See also: netversion, about%{+m|m}, status%{-}
 :hub:chaddr
 :hub:chaddr
 ###  %bchaddr%b <bot> <address[:bot port[/user port]]>
 ###  %bchaddr%b <bot> <address[:bot port[/user port]]>
    Changes the address for a bot. This is the address your bot will try to
    Changes the address for a bot. This is the address your bot will try to
@@ -508,7 +508,8 @@ See also: link
         %bflood-nick%b   Set here how many nick changes in how many seconds from
         %bflood-nick%b   Set here how many nick changes in how many seconds from
                     one host constitutes a flood. Setting this to 0 or 0:0
                     one host constitutes a flood. Setting this to 0 or 0:0
                     disables nick flood protection for the channel.
                     disables nick flood protection for the channel.
-See also: %{+n}+chan, -chan%{+m|m}, chanset
+ 
+See also: %{-}%{+n}+chan, -chan%{-}%{+m|m}, chanset%{-}
 :leaf:channel
 :leaf:channel
 ###  %bchannel%b [channel-name]
 ###  %bchannel%b [channel-name]
    Shows you an extensive display of the users on a channel, and
    Shows you an extensive display of the users on a channel, and
@@ -544,7 +545,7 @@ See also: status, whois
 %{+m}
 %{+m}
    Masters: You can specify other users to see what channels their 
    Masters: You can specify other users to see what channels their 
             flags grant them access to.%{-}
             flags grant them access to.%{-}
-See also: whois%{+m}, chattr, chaninfo
+See also: whois%{+m}, chattr, chaninfo%{-}
 ::chanset
 ::chanset
 ###  %bchanset%b <channel> <settings>
 ###  %bchanset%b <channel> <settings>
    Allows you to change the channel settings (see %b'chaninfo'%b for the
    Allows you to change the channel settings (see %b'chaninfo'%b for the
@@ -596,7 +597,7 @@ See also: whois
    Changes the handle of a user. For example, to change the handle of user
    Changes the handle of a user. For example, to change the handle of user
    'gavroche' to 'jamie', you would use 'chhandle gavroche jamie'.
    'gavroche' to 'jamie', you would use 'chhandle gavroche jamie'.
  
  
-See also: chpass%{+n}, chsecpass
+See also: chpass%{+n}, chsecpass%{-}
 ::chinfo
 ::chinfo
 ###  %bchinfo%b <user> [channel] [info-line/none]
 ###  %bchinfo%b <user> [channel] [info-line/none]
    Sets the information line for a user. This line is shown via the /msg
    Sets the information line for a user. This line is shown via the /msg
@@ -616,7 +617,7 @@ See: chhandle
    join the party line, etc. If the newpassword is 'rand', a random password
    join the party line, etc. If the newpassword is 'rand', a random password
    will be used.
    will be used.
  
  
-See also: chhandle%{+n}, chsecpass
+See also: chhandle%{+n}, chsecpass%{-}
 :hub:chsecpass:
 :hub:chsecpass:
 ###  %bchsecpass%b <handle> [newpassword|rand]
 ###  %bchsecpass%b <handle> [newpassword|rand]
    Changes a user's secpass. If you do not specify the new password, the user
    Changes a user's secpass. If you do not specify the new password, the user
@@ -685,7 +686,7 @@ See also: botconfig
      %bc%b  commands
      %bc%b  commands
      %bo%b  misc info, etc (IMPORTANT STUFF)
      %bo%b  misc info, etc (IMPORTANT STUFF)
      %bw%b  wallops
      %bw%b  wallops
- 
+%{-} 
 %{+n}
 %{+n}
    Owners only (these have to be enabled in the config file via "set raw-log"):
    Owners only (these have to be enabled in the config file via "set raw-log"):
      %be%b  errors
      %be%b  errors
@@ -695,15 +696,15 @@ See also: botconfig
      %bt%b  raw botnet traffic
      %bt%b  raw botnet traffic
      %bu%b  warnings
      %bu%b  warnings
      %bv%b  raw outgoing server traffic
      %bv%b  raw outgoing server traffic
- 
+%{-} 
 %{+o|o}
 %{+o|o}
    The mode can also be a modifier like '+p' or '-jk' or '+mp-b'. If you omit
    The mode can also be a modifier like '+p' or '-jk' or '+mp-b'. If you omit
    the channel and modes, your current console channel and flags will be shown.
    the channel and modes, your current console channel and flags will be shown.
- 
+%{-} 
 %{+m|m}
 %{+m|m}
 ###  %bconsole%b <user> [channel] [modes]
 ###  %bconsole%b <user> [channel] [modes]
    This is used to set the console level of another user. This can even be used
    This is used to set the console level of another user. This can even be used
-   on users who normally would not be able to set their own console mode.
+   on users who normally would not be able to set their own console mode.%{-}
 ::crontab:
 ::crontab:
 ###  %bcrontab%b <status|delete|show|new> [interval]
 ###  %bcrontab%b <status|delete|show|new> [interval]
    This command is used to manipulate the crontab entries for the user
    This command is used to manipulate the crontab entries for the user
@@ -911,14 +912,14 @@ See also: -exempt, +exempt, console%{+m|m}, chanset, chaninfo%{-}, stick, unstic
    If there is a key set for channel, it is displayed. If channel is not
    If there is a key set for channel, it is displayed. If channel is not
    specified, your console channel is used.
    specified, your console channel is used.
  
  
-See also: console, channels%{+m}, status
+See also: console, channels%{+m}, status%{-}
 ::handle
 ::handle
 ###  %bhandle%b <new-handle>
 ###  %bhandle%b <new-handle>
    Changes your handle on the bot. This is the handle (nickname) that the
    Changes your handle on the bot. This is the handle (nickname) that the
    bot will know you as from this point forward. It is used to log into the
    bot will know you as from this point forward. It is used to log into the
    bot.
    bot.
  
  
-See also: newpass%{+m}, %{+i}chhand, chpass%{+n}, chsecpass
+See also: newpass%{+mi}, chhand, chpass%{-}%{+n}, chsecpass%{-}
 ::help:
 ::help:
 ###  %bhelp%b [cmd]
 ###  %bhelp%b [cmd]
    Alone, will show all cmds that match your flags. With a cmd it will show
    Alone, will show all cmds that match your flags. With a cmd it will show
@@ -1070,13 +1071,13 @@ See also: netlag
    Displays the 'last' output from the shell the bot is running on,
    Displays the 'last' output from the shell the bot is running on,
    for the user it is running as.
    for the user it is running as.
  
  
-%{+i}See also: netlast
+%{+i}See also: netlast%{-}
 :hub:link
 :hub:link
 ###  %blink%b [via-bot] <bot-to-link>
 ###  %blink%b [via-bot] <bot-to-link>
    Attempts to link to another hub.  This command is deprecated and not 
    Attempts to link to another hub.  This command is deprecated and not 
    recommended for use.
    recommended for use.
  
  
-See also: unlink, newleaf%{+a}, -bot
+See also: unlink, newleaf%{+a}, -bot%{-}
 ::match
 ::match
 ###  %bmatch%b <attr> [channel] [[start] limit]
 ###  %bmatch%b <attr> [channel] [[start] limit]
    This displays all user records with the attributes requested.
    This displays all user records with the attributes requested.
@@ -1156,13 +1157,13 @@ See also: whois, console
 ::motd
 ::motd
 ###  %bmotd%b %{+m}<message>%{-}
 ###  %bmotd%b %{+m}<message>%{-}
    This redisplays the partyline Message Of The Day, which was shown when you
    This redisplays the partyline Message Of The Day, which was shown when you
-   first joined the partyline.%{+m} Inclue a message to set the motd.
+   first joined the partyline.%{+m} Inclue a message to set the motd.%{-}
 :leaf:msg
 :leaf:msg
 ###  %bmsg%b <nickname> <text>
 ###  %bmsg%b <nickname> <text>
    Sends a private message to someone from the bot, just as if the
    Sends a private message to someone from the bot, just as if the
    bot had typed /msg.
    bot had typed /msg.
  
  
-See also: botmsg%{+n}, netmsg
+See also: botmsg%{+n}, netmsg%{-}
 :hub:netcrontab:
 :hub:netcrontab:
 ###  %bnetcrontab%b <status|delete|show|new> [interval]
 ###  %bnetcrontab%b <status|delete|show|new> [interval]
    Runs the specified command on all linked bots.
    Runs the specified command on all linked bots.
@@ -1204,12 +1205,12 @@ See also: ps
    All bots on the botnet will display their current server and lag
    All bots on the botnet will display their current server and lag
    to that server over DCC.
    to that server over DCC.
  
  
-See also: botserver, servers%{+n}, config
+See also: botserver, servers%{+n}, config%{-}
 ::netversion:
 ::netversion:
 ###  %bnetversion%b <bot>
 ###  %bnetversion%b <bot>
    All bots on the botnet will display their pack version, and uname.
    All bots on the botnet will display their pack version, and uname.
  
  
-See also: botversion, about%{+m|m}, status
+See also: botversion, about%{+m|m}, status%{-}
 :hub:netw:
 :hub:netw:
 ###  %bnetw%b
 ###  %bnetw%b
    All bots on the botnet will run 'w' on their shell and display
    All bots on the botnet will run 'w' on their shell and display
@@ -1228,7 +1229,7 @@ See also: w
    newpassword is 'rand', a random password will be used.
    newpassword is 'rand', a random password will be used.
  
  
  
  
-%{+mi}See also: chpass%{+n}, chsecpass
+%{+mi}See also: chpass%{-}%{+n}, chsecpass%{-}
 ::nick
 ::nick
 See: handle
 See: handle
 ::note
 ::note
@@ -1280,7 +1281,7 @@ See also: echo, color
    Will run 'ps' on the bot's shell and display any results. If
    Will run 'ps' on the bot's shell and display any results. If
    any params are specified, they will be used.
    any params are specified, they will be used.
  
  
-%{+i}See also: netps
+%{+i}See also: netps%{-}
 ::quit
 ::quit
 ###  %bquit%b [comment]
 ###  %bquit%b [comment]
    This disconnects you from the partyline. If you specify a comment, it will
    This disconnects you from the partyline. If you specify a comment, it will
@@ -1294,7 +1295,7 @@ See also: echo, color
    The local bot must, however, have a bot record for the bot you wish to
    The local bot must, however, have a bot record for the bot you wish to
    relay to. Typing .quit or "*bye*" on a line by itself will end the relay.
    relay to. Typing .quit or "*bye*" on a line by itself will end the relay.
  
  
-See also: bots%{+n}, newleaf%{+a}, -bot
+See also: bots%{+n}, newleaf%{-}%{+a}, -bot%{-}
 ::reload
 ::reload
 ###  %breload%b
 ###  %breload%b
    Reloads the bot's user file, discarding any changes made since the last
    Reloads the bot's user file, discarding any changes made since the last
@@ -1318,7 +1319,7 @@ See also: save
    global ban list or channel ban list that are not currently on the
    global ban list or channel ban list that are not currently on the
    channel, they will be added.
    channel, they will be added.
  
  
-See also: bans, console%{+m|m}, reset
+See also: bans, console%{+m|m}, reset%{-}
 :leaf:resetexempts
 :leaf:resetexempts
 ###  %bresetexempts%b [channel]
 ###  %bresetexempts%b [channel]
    resets the bot's exemption list for the channel. this command
    resets the bot's exemption list for the channel. this command
@@ -1355,7 +1356,7 @@ See also: reload, backup
    Changes your secpass on the bot. This is used for Authing via /msg
    Changes your secpass on the bot. This is used for Authing via /msg
    and for DCC. If the password is 'rand', a random password will be used.
    and for DCC. If the password is 'rand', a random password will be used.
  
  
-%{+mi}See also: chpass%{+n}, chsecpass
+%{+mi}See also: chpass%{-}%{+n}, chsecpass%{-}
 :leaf:servers
 :leaf:servers
 ###  %bservers%b
 ###  %bservers%b
    lists the servers that the bot has in its server list.  this is
    lists the servers that the bot has in its server list.  this is
@@ -1387,7 +1388,7 @@ See also: slowpart, chanset, chaninfo
    All bots on the botnet will part the specified channel at the rate
    All bots on the botnet will part the specified channel at the rate
    of one bot per 'interval-seconds'
    of one bot per 'interval-seconds'
  
  
-%{+n}See also: slowjoin
+%{+n}See also: slowjoin%{-}
 ::status
 ::status
 ###  %bstatus%b
 ###  %bstatus%b
 ###  %bstatus all%b
 ###  %bstatus all%b
@@ -1422,7 +1423,7 @@ See also: slowpart, chanset, chaninfo
    information. If you use %b'%dstatus all'%b instead, you will see all status
    information. If you use %b'%dstatus all'%b instead, you will see all status
    information available from loaded modules.
    information available from loaded modules.
  
  
-See also: channel, channels%{+a}, debug
+See also: channel, channels%{+a}, debug%{-}
 ::stick
 ::stick
 ###  %bstick%b [ban/exempt/invite] <hostmask/number> [channel]
 ###  %bstick%b [ban/exempt/invite] <hostmask/number> [channel]
    Makes a ban, exempt, or invite "sticky". This means that the bot will always
    Makes a ban, exempt, or invite "sticky". This means that the bot will always
@@ -1453,7 +1454,7 @@ See also: fixcodes, color, echo, page
 %{+m}
 %{+m}
 ###  %bstrip%b <user> [modes]
 ###  %bstrip%b <user> [modes]
    Set the strip level of another user. A master can't set their own strip
    Set the strip level of another user. A master can't set their own strip
-   flags without prefixing the modes with a '+' or '-'.
+   flags without prefixing the modes with a '+' or '-'.%{-}
 ::su
 ::su
 ###  %bsu%b <user>
 ###  %bsu%b <user>
    Lets you assume the identity of another user. If you are a global owner,
    Lets you assume the identity of another user. If you are a global owner,
@@ -1480,7 +1481,7 @@ See also: bots, bottree, vbottree
    Shows total and daily net traffic stats since the last %b'%drestart'%b.
    Shows total and daily net traffic stats since the last %b'%drestart'%b.
    Stats groups are IRC, Botnet, Partyline, Transfer.mod and Misc.
    Stats groups are IRC, Botnet, Partyline, Transfer.mod and Misc.
  
  
-%{+m}See also: restart
+%{+m}See also: restart%{-}
 ::unlink
 ::unlink
 ###  %bunlink%b <bot|*>
 ###  %bunlink%b <bot|*>
    This disconnects the specified bot from the botnet (assuming it was linked
    This disconnects the specified bot from the botnet (assuming it was linked
@@ -1488,7 +1489,7 @@ See also: bots, bottree, vbottree
    to unlink them. If "*" is specified as the parameter, all bots will be
    to unlink them. If "*" is specified as the parameter, all bots will be
    unlinked.
    unlinked.
  
  
-See also: %{+n}link, %{-}bots, downbots%{+n}, newleaf, bottree, vbottree
+See also: %{+n}link, %{-}bots, downbots%{+n}, newleaf, bottree, vbottree%{-}
 ::unstick
 ::unstick
 ###  %bunstick%b [ban/exempt/invite] <hostmask/number> [channel]
 ###  %bunstick%b [ban/exempt/invite] <hostmask/number> [channel]
    Makes a "sticky" ban, exempt, or invite normal again.
    Makes a "sticky" ban, exempt, or invite normal again.
@@ -1536,7 +1537,7 @@ See also: devoice
    The output of 'w' will be displayed over DCC, bot the shell
    The output of 'w' will be displayed over DCC, bot the shell
    the bot is running on.
    the bot is running on.
  
  
-%{+i}See also: netw
+%{+i}See also: netw%{-}
 ::who
 ::who
 ###  %bwho%b [bot]
 ###  %bwho%b [bot]
    Displays a list of users on the local bot.
    Displays a list of users on the local bot.
@@ -1578,8 +1579,7 @@ See also: devoice
    will see the actual channels other users are on. Also, people in the
    will see the actual channels other users are on. Also, people in the
    filesystem will be listed (as being in channel "files") if the filesys
    filesystem will be listed (as being in channel "files") if the filesys
    module is loaded. A '+' next to the nickname here means the user has
    module is loaded. A '+' next to the nickname here means the user has
-   access to return to the party line.
-%{-}
+   access to return to the party line.%{-}
  
  
 See also: whom
 See also: whom
 ::whoami
 ::whoami
@@ -1645,5 +1645,5 @@ See also: whom
  
  
    Masters: if the user has a comment, you will see it under "COMMENT:".%{-}
    Masters: if the user has a comment, you will see it under "COMMENT:".%{-}
  
  
-See also: match, who, whom%{+m|m}, chattr, chaninfo
+See also: match, who, whom%{+m|m}, chattr, chaninfo%{-}
 ::end
 ::end

+ 15 - 15
src/misc.c

@@ -2049,53 +2049,54 @@ char *btoh(const unsigned char *md, int len)
 #define HELP_UNDER 4
 #define HELP_UNDER 4
 #define HELP_FLASH 8
 #define HELP_FLASH 8
 
 
+/* so many string++ is making the problem */
 void showhelp (int idx, struct flag_record *flags, char *string)
 void showhelp (int idx, struct flag_record *flags, char *string)
 {
 {
   static int help_flags;
   static int help_flags;
-  struct flag_record tr = {FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0};
-  static char helpstr[8092] = "", tmp[2] = "", flagstr[10] = "";
+  struct flag_record fr = {FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0};
+  char helpstr[12288], tmp[2] = "", flagstr[10] = "";
   int ok = 1;
   int ok = 1;
 Context;
 Context;
   helpstr[0] = 0;
   helpstr[0] = 0;
-  while ((string) && (string[0])) {
-    if ((*string == '%')) {
+  while (string && string[0]) {
+    if (*string == '%') {
       if (!strncmp(string + 1, "{+", 2)) {
       if (!strncmp(string + 1, "{+", 2)) {
-        while ((*string) && (*string != '+')) {
+        while (*string && *string != '+') {
           string++;
           string++;
         }
         }
         flagstr[0] = 0;
         flagstr[0] = 0;
-        while ((*string) && (*string != '}')) {
+        while (*string && *string != '}') {
           sprintf(tmp, "%c", *string);
           sprintf(tmp, "%c", *string);
           strcat(flagstr, tmp);
           strcat(flagstr, tmp);
           string++;
           string++;
         }
         }
         string++;
         string++;
-        break_down_flags(flagstr, &tr, NULL);
-        if (flagrec_ok(&tr, flags)) {
+        break_down_flags(flagstr, &fr, NULL);
+        if (flagrec_ok(&fr, flags)) {
           ok = 1;
           ok = 1;
-          while ((*string) && (*string != '%')) {
+          while (*string && *string != '%') {
             sprintf(tmp, "%c", *string);
             sprintf(tmp, "%c", *string);
             strcat(helpstr, tmp);
             strcat(helpstr, tmp);
             string++;
             string++;
           }
           }
           if (!strncmp(string + 1, "{-", 2)) {
           if (!strncmp(string + 1, "{-", 2)) {
             ok = 1;
             ok = 1;
-            while ((*string) && (*string != '}')) {
+            while (*string && *string != '}') {
               string++;
               string++;
             }
             }
+            string++;
           }
           }
-          string++;
         } else {
         } else {
           ok = 0;
           ok = 0;
         }
         }
       } else if (!strncmp(string + 1, "{-", 2)) {
       } else if (!strncmp(string + 1, "{-", 2)) {
         ok = 1;
         ok = 1;
-        while ((*string) && (*string != '}')) {
+        while (*string && *string != '}') {
           string++;
           string++;
         }
         }
         string++;
         string++;
       } else if (*string == '{') {
       } else if (*string == '{') {
-        while ((*string) && (*string != '}')) {
+        while (*string && *string != '}') {
           string++;
           string++;
         }
         }
       } else if (*(string + 1) == 'b') {
       } else if (*(string + 1) == 'b') {
@@ -2138,8 +2139,7 @@ Context;
       string++;
       string++;
     }
     }
   }
   }
-  if (strchr(helpstr, '\0'))
-    *(char*)(strchr(helpstr, '\0')) = 0;
+  helpstr[strlen(helpstr)] = 0;
   if (helpstr[0]) dumplots(idx, "", helpstr);
   if (helpstr[0]) dumplots(idx, "", helpstr);
 }
 }