When displaying Chinese help information, the program does not respond. The code enters a dead loop in file "libgetopt++/include/getopt++/DefaultFormatter.h"£¬Because some Chinese help information does not contain spaces. diff --git a/libgetopt++/include/getopt++/DefaultFormatter.h b/libgetopt++/include/getopt++/DefaultFormatter.h index ee2397f5..19ac67e1 100644 --- a/libgetopt++/include/getopt++/DefaultFormatter.h +++ b/libgetopt++/include/getopt++/DefaultFormatter.h @@ -64,6 +64,7 @@ class DefaultFormatter {         {           // TODO: consider using a line breaking strategy here.           int pos = helpmsg.substr(0,h_len).find_last_of(" "); +         if(pos<=0)break;           theStream << helpmsg.substr(0,pos)                     << std::endl << std::string (o_len, ' ');           helpmsg.erase (0,pos+1);