*
* Citadel/UX client/server IPC - client module using TCP/IP
*
- * version 1.3
+ * version 1.3 $Id$
*
*/
#include <string.h>
#include <pwd.h>
#include <errno.h>
+#include <stdarg.h>
+#include "citadel.h"
#include "citadel_decls.h"
#include "ipc.h"
+#ifndef HAVE_SNPRINTF
+#include "snprintf.h"
+#endif
/*
* If server_is_local is set to nonzero, the client assumes that it is running
struct sockaddr_in sin;
int s,type;
- bzero((char *)&sin,sizeof(sin));
+ memset(&sin,0,sizeof(sin));
sin.sin_family = AF_INET;
pse=getservbyname(service,protocol);
struct servent *pse;
struct sockaddr_in sin;
- bzero((char *)&sin,sizeof(sin));
+ memset(&sin,0,sizeof(sin));
sin.sin_family = AF_INET;
pse=getservbyname(service,protocol);
while(len<bytes) {
rlen = read(serv_sock,&buf[len],bytes-len);
if (rlen<1) {
- printf("\rNetwork error - connection terminated.\n");
- printf("%s\n", strerror(errno));
+ /* printf("\rNetwork error - connection terminated.\n");
+ printf("%s\n", strerror(errno)); */
logoff(3);
}
len = len + rlen;
retval = write(serv_sock, &buf[bytes_written],
nbytes - bytes_written);
if (retval < 1) {
+ /*
printf("\rNetwork error - connection terminated.\n");
- printf("%s\n", strerror(errno));
+ printf("%s\n", strerror(errno)); */
logoff(3);
}
bytes_written = bytes_written + retval;
printf("Attaching to server...\r");
fflush(stdout);
- sprintf(buf,"%c%c",
+ snprintf(buf,sizeof buf,"%c%c",
4, /* version 4 */
1); /* method = connect */
serv_write(buf,2);