Changeset 2325 for trunk/auto-reply

Show
Ignore:
Timestamp:
10/24/00 23:13:41 (8 years ago)
Author:
graham
Message:

Fix for crash when receiving long reply from the command.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/auto-reply/src/autoreply.cpp

    r2211 r2325  
    257257bool CLicqAutoReply::AutoReplyEvent(unsigned long nUin, CUserEvent *event) 
    258258{ 
    259   char m_szMessage[4096], szCommand[4096]; 
    260   char c; 
    261   int pos = 0; 
    262  
    263   for (int i = 0; i < 4096; i++) 
    264   { 
    265     m_szMessage[i] = '\0'; 
    266   } 
     259  char szCommand[4096]; 
    267260 
    268261  char *buf = szCommand; 
     
    284277  } 
    285278 
     279  int pos = 0; 
     280  int c; 
     281  char m_szMessage[4097]; 
    286282  while (((c = fgetc(fStdOut)) != EOF) && (pos < 4096)) 
    287283  { 
    288284    m_szMessage[pos++] = c; 
    289285  } 
     286  m_szMessage[pos] = '\0'; 
     287 
    290288  int r = 0; 
    291289  if ((r = PClose()) != 0 && m_bFailOnExitCode)