Difference for socket/request.c from version 1.79 to 1.80


version 1.79 version 1.80
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_init_c =   * static char *rcsid_init_c =
  *    "$Id: request.c,v 1.79 2006/01/13 07:10:43 mwedel Exp $";   *    "$Id: request.c,v 1.80 2006/01/13 20:42:02 cavesomething Exp $";
  */   */
   
 /*  /*
Line 2015
 
Line 2015
 static void append_spell (player *pl, SockList *sl, object *spell) {  static void append_spell (player *pl, SockList *sl, object *spell) {
     int len, i, skill=0;      int len, i, skill=0;
   
     if (spell->type != SPELL) return;  
     if (!(spell->name)) {      if (!(spell->name)) {
         LOG(llevError, "item number %d is a spell with no name.\n", spell->count);          LOG(llevError, "item number %d is a spell with no name.\n", spell->count);
         return;          return;
Line 2089
 
Line 2088
       * is hundreds of bytes off, so correcting 22 vs 26 doesn't seem        * is hundreds of bytes off, so correcting 22 vs 26 doesn't seem
       * like it will fix this        * like it will fix this
       */        */
        if (spell->type != SPELL) continue;
      if (sl.len > (MAXSOCKBUF - (26 + strlen(spell->name) +        if (sl.len > (MAXSOCKBUF - (26 + strlen(spell->name) +
  spell->msg?strlen(spell->msg):0))) {   (spell->msg?strlen(spell->msg):0)))) {
  Send_With_Handling(&pl->socket, &sl);   Send_With_Handling(&pl->socket, &sl);
  strcpy(sl.buf,"addspell ");   strcpy(sl.buf,"addspell ");
  sl.len=strlen((char*)sl.buf);   sl.len=strlen((char*)sl.buf);
Line 2098
 
Line 2098
      append_spell(pl, &sl, spell);       append_spell(pl, &sl, spell);
  }   }
     }      }
       else if (spell->type != SPELL) {
    LOG(llevError, "Asked to send a non-spell object as a spell");
    return;
       }
     else append_spell(pl, &sl, spell);      else append_spell(pl, &sl, spell);
     if (sl.len > MAXSOCKBUF) {      if (sl.len > MAXSOCKBUF) {
  LOG(llevError,"Buffer overflow in send_spell_list!\n");   LOG(llevError,"Buffer overflow in esrv_add_spells!\n");
  fatal(0);   fatal(0);
     }      }
     /* finally, we can send the packet */      /* finally, we can send the packet */


Legend:
line(s) removed in v.1.79 
line(s) changed
 line(s) added in v.1.80

File made using version 1.98 of cvs2html by leaf at 2011-07-21 19:36