version 1.17 | | version 1.18 |
---|
| | |
/* | | /* |
* static char *rcsid_sock_info_c = | | * static char *rcsid_sock_info_c = |
* "$Id: info.c,v 1.17 2004/01/18 10:36:10 ryo_saeba Exp $"; | | * "$Id: info.c,v 1.18 2004/06/22 06:28:08 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
char buf[HUGE_BUF]; | | char buf[HUGE_BUF]; |
| | |
if (ns->status == Ns_Old) { | | if (ns->status == Ns_Old) { |
sprintf(buf,"%s\n", str); | | snprintf(buf,HUGE_BUF,"%s\n", str); |
} else { | | } else { |
sprintf(buf,"drawinfo %d %s", color, str); | | snprintf(buf,HUGE_BUF, "drawinfo %d %s", color, str); |
} | | } |
/* LOG(llevDebug,"sending %s to socket, len=%d", buf, strlen(buf));*/ | | /* LOG(llevDebug,"sending %s to socket, len=%d", buf, strlen(buf));*/ |
Write_String_To_Socket(ns, buf, strlen(buf)); | | Write_String_To_Socket(ns, buf, strlen(buf)); |
| | |
char tbuf[MAX_BUF]; | | char tbuf[MAX_BUF]; |
| | |
if (outputs->buf==NULL) return; | | if (outputs->buf==NULL) return; |
sprintf(tbuf,"%d times %s", outputs->count, outputs->buf); | | snprintf(tbuf,MAX_BUF, "%d times %s", outputs->count, outputs->buf); |
print_message(NDI_BLACK, pl, tbuf); | | print_message(NDI_BLACK, pl, tbuf); |
free_string(outputs->buf); | | free_string(outputs->buf); |
outputs->buf=NULL; | | outputs->buf=NULL; |
| | |
va_list ap; | | va_list ap; |
va_start(ap, format); | | va_start(ap, format); |
| | |
vsprintf(buf, format, ap); | | vsnprintf(buf, HUGE_BUF, format, ap); |
| | |
va_end(ap); | | va_end(ap); |
| | |
| | |
} | | } |
| | |
sl.buf=malloc(MAXSOCKBUF); | | sl.buf=malloc(MAXSOCKBUF); |
sprintf((char*)sl.buf,"magicmap %d %d %d %d ", (xmax-xmin+1), (ymax-ymin+1), | | snprintf((char*)sl.buf, MAXSOCKBUF, "magicmap %d %d %d %d ", (xmax-xmin+1), (ymax-ymin+1), |
MAGIC_MAP_HALF - xmin, MAGIC_MAP_HALF - ymin); | | MAGIC_MAP_HALF - xmin, MAGIC_MAP_HALF - ymin); |
sl.len=strlen((char*)sl.buf); | | sl.len=strlen((char*)sl.buf); |
| | |
| | |
char buf[MAX_BUF]; | | char buf[MAX_BUF]; |
| | |
if (With!=NULL) { | | if (With!=NULL) { |
sprintf(buf,"%s\t%s\t%d\t%s\t%d\n",Who,What,WhatType,With,WithType); | | snprintf(buf, MAX_BUF, "%s\t%s\t%d\t%s\t%d\n",Who,What,WhatType,With,WithType); |
} | | } |
else { | | else { |
sprintf(buf,"%s\t%s\t%d\n",Who,What,WhatType); | | snprintf(buf,MAX_BUF, "%s\t%s\t%d\n",Who,What,WhatType); |
} | | } |
len=strlen(buf); | | len=strlen(buf); |
for(i=1; i<socket_info.allocated_sockets; i++) { | | for(i=1; i<socket_info.allocated_sockets; i++) { |