Update plugins to cast time_t to long when formatting with %ld.
Fixes platforms where time_t and long are different sizes. git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@474 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
@@ -338,7 +338,7 @@ int toc_callback(int fd)
|
|||||||
if (!strcasecmp(c,"UPDATE_BUDDY")) {
|
if (!strcasecmp(c,"UPDATE_BUDDY")) {
|
||||||
char *uc, *t;
|
char *uc, *t;
|
||||||
int logged, evil, idle, type = 0;
|
int logged, evil, idle, type = 0;
|
||||||
time_t signon;
|
long signon;
|
||||||
time_t time_idle;
|
time_t time_idle;
|
||||||
|
|
||||||
numargs = 7;
|
numargs = 7;
|
||||||
|
|||||||
@@ -318,9 +318,9 @@ BUILT_IN_DLL(cavgen)
|
|||||||
{
|
{
|
||||||
char *nick = next_arg(args, &args);
|
char *nick = next_arg(args, &args);
|
||||||
if (nick)
|
if (nick)
|
||||||
sprintf(buffer, "msg %s PING %ld\n", nick, time(NULL));
|
sprintf(buffer, "msg %s PING %ld\n", nick, (long)time(NULL));
|
||||||
else
|
else
|
||||||
sprintf(buffer, "say PING %ld\n", time(NULL));
|
sprintf(buffer, "say PING %ld\n", (long)time(NULL));
|
||||||
}
|
}
|
||||||
else if (!my_stricmp(command, "CVERSION"))
|
else if (!my_stricmp(command, "CVERSION"))
|
||||||
sprintf(buffer, "version\n");
|
sprintf(buffer, "version\n");
|
||||||
@@ -466,7 +466,14 @@ char *text = NULL;
|
|||||||
text = alloca(100);
|
text = alloca(100);
|
||||||
for (i = 0; i < repcount; i++)
|
for (i = 0; i < repcount; i++)
|
||||||
{
|
{
|
||||||
snprintf(buffer, IRCD_BUFFER_SIZE, "%ld%ld%ld %ld%ld%ld %ld%ld%ld %ld%ld%ld", cav_randm(time(NULL))+i, cav_randm(time(NULL))+i, time(NULL)+i, cav_randm(time(NULL))+i, cav_randm(time(NULL))+i, time(NULL)+i, cav_randm(time(NULL))+i, cav_randm(time(NULL))+i, time(NULL)+i, cav_randm(time(NULL))+i, cav_randm(time(NULL))+i, time(NULL)+i);
|
snprintf(buffer, IRCD_BUFFER_SIZE,
|
||||||
|
"%ld%ld%ld %ld%ld%ld %ld%ld%ld %ld%ld%ld", cav_randm(time(NULL))+i,
|
||||||
|
cav_randm(time(NULL))+i, (long)(time(NULL)+i),
|
||||||
|
cav_randm(time(NULL))+i, cav_randm(time(NULL))+i,
|
||||||
|
(long)(time(NULL)+i), cav_randm(time(NULL))+i,
|
||||||
|
cav_randm(time(NULL))+i, (long)(time(NULL)+i),
|
||||||
|
cav_randm(time(NULL))+i, cav_randm(time(NULL))+i,
|
||||||
|
(long)(time(NULL)+i));
|
||||||
for (i = 0; i < cav_randm(80); i++)
|
for (i = 0; i < cav_randm(80); i++)
|
||||||
text[i] = cav_randm(255)+1;
|
text[i] = cav_randm(255)+1;
|
||||||
snprintf(buffer, IRCD_BUFFER_SIZE, "PRIVMSG %s :DCC SEND %s 2293243493 8192 6978632", target, text);
|
snprintf(buffer, IRCD_BUFFER_SIZE, "PRIVMSG %s :DCC SEND %s 2293243493 8192 6978632", target, text);
|
||||||
@@ -558,7 +565,7 @@ char buffer[BIG_BUFFER_SIZE+1];
|
|||||||
else if (!my_stricmp(type, "version_flood") && get_dllint_var("cavlink_floodversion"))
|
else if (!my_stricmp(type, "version_flood") && get_dllint_var("cavlink_floodversion"))
|
||||||
snprintf(buffer, IRCD_BUFFER_SIZE, "PRIVMSG %s :VERSION", target);
|
snprintf(buffer, IRCD_BUFFER_SIZE, "PRIVMSG %s :VERSION", target);
|
||||||
else if (!my_stricmp(type, "ping_flood") && get_dllint_var("cavlink_floodping"))
|
else if (!my_stricmp(type, "ping_flood") && get_dllint_var("cavlink_floodping"))
|
||||||
snprintf(buffer, IRCD_BUFFER_SIZE, "PRIVMSG %s :PING %ld", target, time(NULL));
|
snprintf(buffer, IRCD_BUFFER_SIZE, "PRIVMSG %s :PING %ld", target, (long)time(NULL));
|
||||||
else if (!my_stricmp(type, "echo_flood") && get_dllint_var("cavlink_floodecho"))
|
else if (!my_stricmp(type, "echo_flood") && get_dllint_var("cavlink_floodecho"))
|
||||||
snprintf(buffer, IRCD_BUFFER_SIZE, "PRIVMSG %s :ECHO %s", target, extra);
|
snprintf(buffer, IRCD_BUFFER_SIZE, "PRIVMSG %s :ECHO %s", target, extra);
|
||||||
else if (!my_stricmp(type, "message_flood") && get_dllint_var("cavlink_floodmsg"))
|
else if (!my_stricmp(type, "message_flood") && get_dllint_var("cavlink_floodmsg"))
|
||||||
|
|||||||
@@ -1049,7 +1049,7 @@ char *fserv_savname = NULL;
|
|||||||
if (statistics.files_served)
|
if (statistics.files_served)
|
||||||
{
|
{
|
||||||
fprintf(fp, "%s%s %lu\n", bogus, "_totalserved", statistics.files_served);
|
fprintf(fp, "%s%s %lu\n", bogus, "_totalserved", statistics.files_served);
|
||||||
fprintf(fp, "%s%s %lu\n", bogus, "_totalstart", statistics.starttime);
|
fprintf(fp, "%s%s %ld\n", bogus, "_totalstart", (long)statistics.starttime);
|
||||||
fprintf(fp, "%s%s %lu\n", bogus, "_totalsizeserved", statistics.filesize_served);
|
fprintf(fp, "%s%s %lu\n", bogus, "_totalsizeserved", statistics.filesize_served);
|
||||||
}
|
}
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|||||||
@@ -862,8 +862,9 @@ unsigned int scan_mp3_dir(char *path, int recurse, int reload, int share, int se
|
|||||||
count++;
|
count++;
|
||||||
if (share && (nap_socket != -1))
|
if (share && (nap_socket != -1))
|
||||||
{
|
{
|
||||||
sprintf(buffer, "\"%s\" %s %lu %u %u %lu", new->filename,
|
sprintf(buffer, "\"%s\" %s %lu %u %u %ld", new->filename,
|
||||||
new->checksum, new->filesize, new->bitrate, new->freq, new->time);
|
new->checksum, new->filesize, new->bitrate, new->freq,
|
||||||
|
(long)new->time);
|
||||||
send_ncommand(CMDS_ADDFILE, convertnap_dos(buffer));
|
send_ncommand(CMDS_ADDFILE, convertnap_dos(buffer));
|
||||||
statistics.shared_files++;
|
statistics.shared_files++;
|
||||||
statistics.shared_filesize += new->filesize;
|
statistics.shared_filesize += new->filesize;
|
||||||
@@ -971,9 +972,9 @@ Files *new;
|
|||||||
{
|
{
|
||||||
for (new = fserv_files; new; new = new->next)
|
for (new = fserv_files; new; new = new->next)
|
||||||
{
|
{
|
||||||
fprintf(fp, "\"%s\" %s %lu %u %u %lu\n",
|
fprintf(fp, "\"%s\" %s %lu %u %u %ld\n",
|
||||||
new->filename, new->checksum, new->filesize,
|
new->filename, new->checksum, new->filesize,
|
||||||
new->bitrate, new->freq, new->time);
|
new->bitrate, new->freq, (long)new->time);
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
@@ -1121,8 +1122,9 @@ Files *new;
|
|||||||
|
|
||||||
if (new->freq && new->bitrate)
|
if (new->freq && new->bitrate)
|
||||||
{
|
{
|
||||||
sprintf(buffer, "\"%s\" %s %lu %u %u %lu", name,
|
sprintf(buffer, "\"%s\" %s %lu %u %u %ld", name,
|
||||||
new->checksum, new->filesize, new->bitrate, new->freq, new->time);
|
new->checksum, new->filesize, new->bitrate, new->freq,
|
||||||
|
(long)new->time);
|
||||||
cmd = CMDS_ADDFILE;
|
cmd = CMDS_ADDFILE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user