Ignore:
Timestamp:
21/08/06 15:29:14 (13 years ago)
Author:
spascoe
Message:

ALL TEST SUCCEED ON EASTERLY.

A bug in my message passing code, due to me missunderstanding
bbftp_private_send/recv.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/trunk/src/bbftp-client-3.2.0/bbftpc/bbftp_private_user.c

    r1428 r1430  
    4343int ndg_client_auth(char *logmessage); 
    4444#endif // NDG_PRIVATE_AUTH 
    45  
    4645 
    4746/* 
     
    200199 
    201200  sprintf(ctrl, "NDG-msg: %i", length); 
    202   if (bbftp_private_send(ctrl, NDG_MESSAGE_LEN, logmessage) == -1) { 
     201  if (bbftp_private_send(ctrl, NDG_MESSAGE_LEN - 1, logmessage) == -1) { 
    203202    return -1; 
    204203  } 
     
    222221  char ctrl[NDG_MESSAGE_LEN]; 
    223222 
    224   if (bbftp_private_recv(ctrl, NDG_MESSAGE_LEN, logmessage) == -1) { 
     223  if (bbftp_private_recv(ctrl, NDG_MESSAGE_LEN - 1, logmessage) == -1) { 
    225224    return -1; 
    226225  } 
     
    230229  } 
    231230 
    232   if ((*buffer = (char *)malloc(*length * sizeof(char))) == NULL) { 
     231  if ((*buffer = (char *)malloc((*length + 1) * sizeof(char))) == NULL) { 
    233232    sprintf(logmessage, "ngd_message_recv malloc error"); 
    234233    return -1; 
     
    236235 
    237236  if (bbftp_private_recv(*buffer, *length, logmessage) == -1) { 
    238     free(*buffer); *buffer = NULL; 
     237    free(*buffer); 
    239238    return -1; 
    240239  } 
Note: See TracChangeset for help on using the changeset viewer.