Ok I am trying to modify the whois snippet from the snippet archive on the
FTP site, but I am getting a compiler warning and if i initiate whois from
within the mud, it crashes. So let me start off by pasting the function as I
have modified it:
ACMD(do_whois)
{
struct char_data *victim = 0;
struct char_file_u tmp_store;
skip_spaces(&argument);
if (!*argument) {
send_to_char("Who do you want to know about?\r\n", ch);
} else {
CREATE(victim, struct char_data, 1);
clear_char(victim);
if (load_char(argument, &tmp_store) > -1) {
store_to_char(&tmp_store, victim);
sprintf(buf, "%s %s is a level %d %s %s %s,\r\n",
/* sprintf(buf, "Level: %d\r\nClass: %s\r\nRace : %s\r\nBrand:
%s\r\n", GET_LEVEL(victim), */
GET_NAME(victim),
(victim->player.title),
GET_LEVEL(victim),
GET_SEX(victim),
pc_race_types[(int) GET_RACE(victim)],
pc_class_types[(int) GET_CLASS(victim)]);
<---- this is line 2007
/* pc_deity_types[(int) GET_DEITY(victim)]); */
send_to_char(buf, ch);
} else {
send_to_char("There is no such player.\r\n", ch);
}
free(victim);
}
}
Ok when I compile this I get the warning:
act.informative.c: In function `do_whois':
act.informative.c:2007: warning: format argument is not a pointer (arg 6)
Not sure what I am doing wrong here, I borrowed parts of do_char_stat in
act.wizard.c to modify whois. Can anyone tell me what I am doing wrong? I am
sure its something simple but I am learning C by reverse engineering the
source, not some book. so im not sure what the warning message means
Thanks
Malevolent
http://www.illusionmud.com
+------------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
| http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
+------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 04/10/01 PDT