On 12/22/97 9:54 PM, Chuck Reed (creed@I-55.COM) stated:
<< Other Info Snipped >>
>ACMD(do_enter)
>{
> int to_room, mode;
> char arg1[MAX_INPUT_LENGTH], *buf1;
> struct obj_data *obj;
> struct char_data *tmp_char;
>
> one_argument(argument, arg1);
>
> if(!*arg1)
> send_to_char("What would you like to enter?\r\n", ch);
> else {
>
> mode = generic_find(arg1, FIND_OBJ_INV | FIND_OBJ_ROOM, ch, &tmp_char,
>&obj);
> if(!obj)
> send_to_char("There is nothing of that nature to enter here.\r\n", ch);
> else {
> if(obj->obj_flags.type_flag != ITEM_PORTAL)
> send_to_char("Yeah smart guy, you just try and enter that . .
>.\r\n", ch);
> else {
Here is the problem line:
> sprintf(buf1, "%d", obj->obj_flags.value[1]);
End of problem.
> to_room = find_target_room(ch, buf1);
> char_from_room(ch);
> char_to_room(ch, to_room);
> send_to_char(OK, ch);
> }
> }
> }
>}
You never initialize "buf1". Basically on compile you should be getting
the warning that buf1 is not initialized before use.
- Chris Jacobson
+------------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
| http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
+------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/08/00 PST