[CF-Devel] CVS update: crossfire/server

Crossfire CVS devel mwedel at scruznet.com
Tue Jun 27 23:53:58 CDT 2000


Date:	Tuesday June 27, 2000 @ 21:53
Author:	cvs

Update of /home/cvs/CVS/crossfire/server
In directory boltzmann:/tmp/cvs-serv2356/server

Modified Files:
	c_object.c input.c 
Log Message:
server/c_object.c: Fix command_drop which was doing incorrect check for
invisible object - it was supposed to skip over them and only do visible
objects, instead it was doing the reverse.  Fixes the 'drop command.
MSW 6/27/2000

server/input.c: Make the inventory command more robust for very long
object names - specify a maximum number of characters we will take from
the name.  Without this, you could get buffer overruns that cause crashes.
No normally generated items would ever likely have names long enough to
exploit this bug however.  MSW 6/27/2000



****************************************

Index: crossfire/server/c_object.c
diff -u crossfire/server/c_object.c:1.8 crossfire/server/c_object.c:1.9
--- crossfire/server/c_object.c:1.8	Wed Jun 21 02:34:56 2000
+++ crossfire/server/c_object.c	Tue Jun 27 21:53:58 2000
@@ -1,6 +1,6 @@
 /*
  * static char *rcsid_c_object_c =
- *   "$Id: c_object.c,v 1.8 2000/06/21 09:34:56 jec Exp $";
+ *   "$Id: c_object.c,v 1.9 2000/06/28 04:53:58 cvs Exp $";
  */
 /*
     CrossFire, A Multiplayer game for X-windows
@@ -827,7 +827,7 @@
 	for (tmp=op->inv; tmp; tmp=next) {
 	    next=tmp->below;
 	    if (QUERY_FLAG(tmp,FLAG_NO_DROP) || 
-		!tmp->invisible) continue;
+		tmp->invisible) continue;
 	    if (item_matched_string(op,tmp,params)) {
 		drop(op, tmp);
 		did_one=1;
Index: crossfire/server/input.c
diff -u crossfire/server/input.c:1.10 crossfire/server/input.c:1.11
--- crossfire/server/input.c:1.10	Sun Jun 18 15:35:59 2000
+++ crossfire/server/input.c	Tue Jun 27 21:53:58 2000
@@ -1,6 +1,6 @@
 /*
  * static char *rcsid_input_c =
- *   "$Id: input.c,v 1.10 2000/06/18 22:35:59 jec Exp $";
+ *   "$Id: input.c,v 1.11 2000/06/28 04:53:58 cvs Exp $";
  */
 /*
     CrossFire, A Multiplayer game for X-windows
@@ -330,7 +330,7 @@
       new_draw_info(NDI_UNIQUE, 0,op,"You carry nothing.");
       return;
     } else {
-      length = 30;
+      length = 28;
       in = "";
       if (op)
         clear_win_info(op);
@@ -340,7 +340,7 @@
     if (items==0) 
       return;
     else { 
-      length = 30;
+      length = 28;
       in = "  ";
     }
   }
@@ -349,10 +349,11 @@
        (inv && inv->type != CONTAINER && !QUERY_FLAG(tmp, FLAG_APPLIED))))
       continue;
     if((!op || QUERY_FLAG(op, FLAG_WIZ)))
-      (void) sprintf(buf,"%s- %-*s (%5d) %-8s", in, length, query_name(tmp),
-                     tmp->count,query_weight(tmp));
+      (void) sprintf(buf,"%s- %-*.*s (%5d) %-8s", in, length, length,
+		     query_name(tmp), tmp->count,query_weight(tmp));
     else
-      (void) sprintf(buf,"%s- %-*s %-8s", in, length+8, query_name(tmp),
+      (void) sprintf(buf,"%s- %-*.*s %-8s", in, length+8, 
+		     length+8, query_name(tmp),
                      query_weight(tmp));
     new_draw_info(NDI_UNIQUE, 0,op,buf);
   }

    
    


More information about the crossfire mailing list