#if STDC_HEADERS
# include <stdlib.h>
# include <string.h>
+# include <stdarg.h>
#else /* not STDC_HEADERS */
# if HAVE_STRING_H
# include <string.h>
/* added routine for printf style output to ics */
void ics_printf(char *format, ...)
{
- char buffer[MSG_SIZ], *args;
-
- args = (char *)&format + sizeof(format);
- vsnprintf(buffer, sizeof(buffer), format, args);
- buffer[sizeof(buffer)-1] = '\0';
- SendToICS(buffer);
+ char buffer[MSG_SIZ];
+ va_list args;
+
+ va_start(args, format);
+ vsnprintf(buffer, sizeof(buffer), format, args);
+ buffer[sizeof(buffer)-1] = '\0';
+ SendToICS(buffer);
+ va_end(args);
}
void
sprintf(str,
"/set-quietly interface %s\n/set-quietly style 12\n",
programVersion);
- strcat(str, "/set-quietly wrap 0\n");
-
+ if (!appData.noJoin)
+ strcat(str, "/set-quietly wrap 0\n");
} else if (ics_type == ICS_CHESSNET) {
sprintf(str, "/style 12\n");
} else {
#ifdef WIN32
strcat(str, "$iset nohighlight 1\n");
#endif
- strcat(str, "$iset nowrap 1\n");
+ if (!appData.noJoin)
+ strcat(str, "$iset nowrap 1\n");
strcat(str, "$iset lock 1\n$style 12\n");
}
SendToICS(str);
fprintf(f, " ");
linelen++;
}
- fprintf(f, numtext);
+ fprintf(f, "%s", numtext);
linelen += numlen;
/* Get move */
fprintf(f, " ");
linelen++;
}
- fprintf(f, move_buffer);
+ fprintf(f, "%s", move_buffer);
linelen += movelen;
/* [AS] Add PV info if present */
fprintf(f, " ");
linelen++;
}
- fprintf(f, move_buffer);
+ fprintf(f, "%s", move_buffer);
linelen += movelen;
}