-/* $Id: kadm_funcs.c,v 1.1.1.1 1995/12/14 06:52:49 tholo Exp $ */
+/* $Id: kadm_funcs.c,v 1.2 1996/09/16 18:48:49 millert Exp $ */
/*-
* Copyright (C) 1989 by the Massachusetts Institute of Technology
char checkname[MAX_K_NAME_SZ];
char filename[MAXPATHLEN];
- (void) sprintf(checkname, "%s.%s@%s", pname, pinst, prealm);
+ (void) snprintf(checkname, sizeof(checkname), "%s.%s@%s", pname, pinst,
+ prealm);
switch (acltype) {
case ADDACL:
- (void) sprintf(filename, "%s%s", acldir, ADD_ACL_FILE);
+ (void) snprintf(filename, sizeof(filename), "%s%s", acldir, ADD_ACL_FILE);
break;
case GETACL:
- (void) sprintf(filename, "%s%s", acldir, GET_ACL_FILE);
+ (void) snprintf(filename, sizeof(filename), "%s%s", acldir, GET_ACL_FILE);
break;
case MODACL:
- (void) sprintf(filename, "%s%s", acldir, MOD_ACL_FILE);
+ (void) snprintf(filename, sizeof(filename), "%s%s", acldir, MOD_ACL_FILE);
break;
}
return(acl_check(filename, checkname));
-/* $Id: krb_lib.c,v 1.1.1.1 1995/12/14 06:52:36 tholo Exp $ */
+/* $Id: krb_lib.c,v 1.2 1996/09/16 18:48:51 millert Exp $ */
/*-
* Copyright (C) 1989 by the Massachusetts Institute of Technology
/* and mod date string */
tp = k_localtime(&principal->mod_date);
- (void) sprintf(principal->mod_date_txt, "%4d-%2d-%2d",
- tp->tm_year > 1900 ? tp->tm_year : tp->tm_year + 1900,
- tp->tm_mon + 1, tp->tm_mday); /* January is 0, not 1 */
+ (void) snprintf(principal->mod_date_txt, sizeof(principal->mod_date_txt),
+ "%4d-%2d-%2d",
+ tp->tm_year > 1900 ? tp->tm_year : tp->tm_year + 1900,
+ tp->tm_mon + 1, tp->tm_mday); /* January is 0, not 1 */
#ifdef DEBUG
if (kerb_debug & 1) {
int i;
-/* $Id: kdb_edit.c,v 1.1.1.1 1995/12/14 06:52:42 tholo Exp $ */
+/* $Id: kdb_edit.c,v 1.2 1996/09/16 18:48:53 millert Exp $ */
/*-
* Copyright 1987, 1988 by the Student Information Processing Board
principal_data[0].key_version = 0; /* bumped up later */
}
tp = k_localtime(&principal_data[0].exp_date);
- (void) sprintf(principal_data[0].exp_date_txt, "%4d-%02d-%02d",
- tp->tm_year > 1900 ? tp->tm_year : tp->tm_year + 1900,
- tp->tm_mon + 1, tp->tm_mday); /* January is 0, not 1 */
+ (void) snprintf(principal_data[0].exp_date_txt,
+ sizeof(principal_data[0].exp_date_txt), "%4d-%02d-%02d",
+ tp->tm_year > 1900 ? tp->tm_year : tp->tm_year + 1900,
+ tp->tm_mon + 1, tp->tm_mday); /* January is 0, not 1 */
for (i = 0; i < j; i++) {
for (;;) {
fprintf(stdout,
-/* $Id: kerberos.c,v 1.1.1.1 1995/12/14 06:52:52 tholo Exp $ */
+/* $Id: kerberos.c,v 1.2 1996/09/16 18:48:54 millert Exp $ */
/*-
* Copyright 1987, 1988 by the Student Information Processing Board
pause();
} else {
char buf[256];
- sprintf(buf, "Kerberos will wait %d seconds before dying so as not to loop init", pause_int);
+ (void) snprintf(buf, sizeof(buf),
+ "Kerberos will wait %d seconds before dying so as not to loop init",
+ pause_int);
klog(L_KRB_PERR, buf);
sleep(pause_int);
klog(L_KRB_PERR, "Do svedania....\n");
char *month_sname(int n);
tm = localtime(t);
- (void) sprintf(st,"%2d-%s-%02d %02d:%02d:%02d",tm->tm_mday,
- month_sname(tm->tm_mon + 1),tm->tm_year,
- tm->tm_hour, tm->tm_min, tm->tm_sec);
+ (void) snprintf(st, sizeof(st_data), "%2d-%s-%02d %02d:%02d:%02d",
+ tm->tm_mday, month_sname(tm->tm_mon + 1), tm->tm_year,
+ tm->tm_hour, tm->tm_min, tm->tm_sec);
return st;
}
-/* $Id: kpropd.c,v 1.2 1995/12/14 08:43:50 tholo Exp $ */
+/* $Id: kpropd.c,v 1.3 1996/09/16 18:48:56 millert Exp $ */
/*-
* Copyright 1987 by the Massachusetts Institute of Technology.
n = krb_net_read (in, (char *)&length, sizeof length);
if (n == 0) break;
if (n < 0) {
- sprintf (errmsg, "kpropd: read: %s", strerror(errno));
+ snprintf (errmsg, sizeof(errmsg), "kpropd: read: %s", strerror(errno));
klog (L_KRB_PERR, errmsg);
SlowDeath();
}
length = ntohl (length);
if (length > sizeof buf) {
- sprintf (errmsg, "kpropd: read length %ld, bigger than buf %d",
- length, (int)(sizeof(buf)));
+ snprintf (errmsg, sizeof(errmsg),
+ "kpropd: read length %ld, bigger than buf %d",
+ length, (int)(sizeof(buf)));
klog (L_KRB_PERR, errmsg);
SlowDeath();
}
n = krb_net_read(in, buf, length);
if (n < 0) {
- sprintf(errmsg, "kpropd: read: %s", strerror(errno));
+ snprintf(errmsg, sizeof(errmsg), "kpropd: read: %s", strerror(errno));
klog(L_KRB_PERR, errmsg);
SlowDeath();
}
kerror = krb_rd_safe (buf, n, &ad->session,
remote, local, &msg_data);
if (kerror != KSUCCESS) {
- sprintf (errmsg, "kpropd: %s: %s",
+ snprintf (errmsg, sizeof(errmsg), "kpropd: %s: %s",
private ? "krb_rd_priv" : "krb_rd_safe",
krb_err_txt[kerror]);
klog (L_KRB_PERR, errmsg);
}
if (write(out, msg_data.app_data, msg_data.app_length) !=
msg_data.app_length) {
- sprintf(errmsg, "kpropd: write: %s", strerror(errno));
+ snprintf(errmsg, sizeof(errmsg), "kpropd: write: %s", strerror(errno));
klog(L_KRB_PERR, errmsg);
SlowDeath();
}
n = read (in, buf, sizeof buf);
if (n == 0) break;
if (n < 0) {
- sprintf (errmsg, "kpropd: read: %s", strerror(errno));
+ snprintf (errmsg, sizeof(errmsg), "kpropd: read: %s", strerror(errno));
klog (L_KRB_PERR, errmsg);
SlowDeath();
}
if (write(out, buf, n) != n) {
- sprintf(errmsg, "kpropd: write: %s", strerror(errno));
+ snprintf(errmsg, sizeof(errmsg), "kpropd: write: %s", strerror(errno));
klog(L_KRB_PERR, errmsg);
SlowDeath();
}
sin.sin_family = AF_INET;
if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
- sprintf(errmsg, "kpropd: socket: %s", strerror(errno));
+ snprintf(errmsg, sizeof(errmsg), "kpropd: socket: %s", strerror(errno));
klog(L_KRB_PERR, errmsg);
SlowDeath();
}
if (bind(s, (struct sockaddr*)&sin, sizeof sin) < 0) {
- sprintf(errmsg, "kpropd: bind: %s", strerror(errno));
+ snprintf(errmsg, sizeof(errmsg), "kpropd: bind: %s", strerror(errno));
klog(L_KRB_PERR, errmsg);
SlowDeath();
}
if (!rflag) {
kerror = krb_get_lrealm(my_realm,1);
if (kerror != KSUCCESS) {
- sprintf (errmsg, "kpropd: Can't get local realm. %s",
+ snprintf(errmsg, sizeof(errmsg), "kpropd: Can't get local realm. %s",
krb_err_txt[kerror]);
klog (L_KRB_PERR, errmsg);
SlowDeath();
for (;;) {
from_len = sizeof from;
if ((s2 = accept(s, (struct sockaddr *) &from, &from_len)) < 0) {
- sprintf(errmsg, "kpropd: accept: %s", strerror(errno));
+ snprintf(errmsg, sizeof(errmsg), "kpropd: accept: %s", strerror(errno));
klog(L_KRB_PERR, errmsg);
continue;
}
strcpy(hostname, hp->h_name);
}
- sprintf(errmsg, "Connection from %s, %s", hostname, from_str);
+ snprintf(errmsg, sizeof(errmsg), "Connection from %s, %s", hostname,
+ from_str);
klog(L_KRB_PERR, errmsg);
/* for krb_rd_{priv, safe} */
}
if ((fdlock = open(local_temp, O_WRONLY | O_CREAT, 0600)) < 0) {
- sprintf(errmsg, "kpropd: open: %s", strerror(errno));
+ snprintf(errmsg, sizeof(errmsg), "kpropd: open: %s", strerror(errno));
klog(L_KRB_PERR, errmsg);
SlowDeath();
}
if (flock(fdlock, LOCK_EX | LOCK_NB)) {
- sprintf(errmsg, "kpropd: flock: %s", strerror(errno));
+ snprintf(errmsg, sizeof(errmsg), "kpropd: flock: %s", strerror(errno));
klog(L_KRB_PERR, errmsg);
SlowDeath();
}
if ((fd = creat(local_temp, 0600)) < 0) {
- sprintf(errmsg, "kpropd: creat: %s", strerror(errno));
+ snprintf(errmsg, sizeof(errmsg), "kpropd: creat: %s", strerror(errno));
klog(L_KRB_PERR, errmsg);
SlowDeath();
}
}
if (strncmp (buf, kprop_version, sizeof (kprop_version))
!= 0) {
- sprintf (errmsg, "kpropd: unsupported version %s", buf);
+ snprintf (errmsg, sizeof(errmsg), "kpropd: unsupported version %s", buf);
klog (L_KRB_PERR, errmsg);
SlowDeath();
}
session_sched,
version);
if (kerror != KSUCCESS) {
- sprintf (errmsg, "kpropd: %s: Calling getkdata",
- krb_err_txt[kerror]);
+ snprintf (errmsg, sizeof(errmsg), "kpropd: %s: Calling getkdata",
+ krb_err_txt[kerror]);
klog (L_KRB_PERR, errmsg);
SlowDeath();
}
- sprintf (errmsg, "kpropd: Connection from %s.%s@%s",
- auth_dat.pname, auth_dat.pinst, auth_dat.prealm);
+ snprintf (errmsg, sizeof(errmsg), "kpropd: Connection from %s.%s@%s",
+ auth_dat.pname, auth_dat.pinst, auth_dat.prealm);
klog (L_KRB_PERR, errmsg);
/* AUTHORIZATION is done here. We might want to expand this to
recv_clear (s2, fd);
break;
default:
- sprintf (errmsg, "kpropd: bad transfer mode %d", transfer_mode);
+ snprintf (errmsg, sizeof(errmsg), "kpropd: bad transfer mode %d",
+ transfer_mode);
klog (L_KRB_PERR, errmsg);
SlowDeath();
}
klog(L_KRB_PERR, "File received.");
if (rename(local_temp, local_file) < 0) {
- sprintf(errmsg, "kpropd: rename: %s", strerror(errno));
+ snprintf(errmsg, sizeof(errmsg), "kpropd: rename: %s", strerror(errno));
klog(L_KRB_PERR, errmsg);
SlowDeath();
}
klog(L_KRB_PERR, "Temp file renamed to %s", local_file);
if (flock(fdlock, LOCK_UN)) {
- sprintf(errmsg, "kpropd: flock (unlock): %s",
- strerror(errno));
+ snprintf(errmsg, sizeof(errmsg), "kpropd: flock (unlock): %s",
+ strerror(errno));
klog(L_KRB_PERR, errmsg);
SlowDeath();
}
close(fdlock);
- sprintf(cmd, "%s load %s %s\n", kdb_util_path, local_file, local_db);
+ snprintf(cmd, sizeof(cmd), "%s load %s %s\n", kdb_util_path, local_file,
+ local_db);
if (system (cmd) != 0) {
klog (L_KRB_PERR, "Couldn't load database");
SlowDeath();
while (n = read(fd, buf, sizeof buf)) {
if (n < 0) {
- sprintf(errmsg, "kpropd: read (in checksum test): %s",
- strerror(errno));
+ snprintf(errmsg, sizeof(errmsg), "kpropd: read (in checksum test): %s",
+ strerror(errno));
klog(L_KRB_PERR, errmsg);
SlowDeath();
}
logtype_array[L_ERR_UNK] = 1;
}
- (void) sprintf(logtxt,format,a1,a2,a3,a4,a5,a6,a7,a8,a9,a0);
+ (void) snprintf(logtxt,sizeof(logtxt),format,a1,a2,a3,a4,a5,a6,a7,a8,a9,a0);
if (!logtype_array[type])
return(logtxt);
for (i=0; i<parmcount; i++) {
if (strcmp(strutol(keyword),parm[i].keyword)==0) {
if (parm[i].value) {
- sprintf(ErrorMsg,"duplicate keyword \"%s\" found",
- keyword);
+ snprintf(ErrorMsg, sizeof(ErrorMsg),
+ "duplicate keyword \"%s\" found", keyword);
return(PS_BAD_KEYWORD);
}
parm[i].value = strsave( value );
}
}
if (i >= parmcount) {
- sprintf(ErrorMsg, "unrecognized keyword \"%s\" found",
- keyword);
+ snprintf(ErrorMsg, sizeof(ErrorMsg),
+ "unrecognized keyword \"%s\" found", keyword);
return(PS_BAD_KEYWORD);
}
break;
default:
- sprintf(ErrorMsg,
+ snprintf(ErrorMsg, sizeof(ErrorMsg),
"panic: bad return (%d) from fGetToken()",rc);
break;
}
return(KV_EOF);
case GTOK_BAD_QSTRING:
- sprintf(ErrorMsg,"unterminated string \"%s found",keyword);
+ snprintf(ErrorMsg, sizeof(ErrorMsg),
+ "unterminated string \"%s found",keyword);
return(KV_SYNTAX);
case GTOK_PUNK:
if (strcmp("\n",keyword)==0) {
return(KV_EOL);
} else if (strcmp(",",keyword)!=0) {
- sprintf(ErrorMsg,"expecting rvalue, found \'%s\'",keyword);
+ snprintf(ErrorMsg, sizeof(ErrorMsg),
+ "expecting rvalue, found \'%s\'", keyword);
}
break;
break;
default:
- sprintf(ErrorMsg,"panic: bad return (%d) from fGetToken()",rc);
+ snprintf(ErrorMsg, sizeof(ErrorMsg),
+ "panic: bad return (%d) from fGetToken()", rc);
return(KV_SYNTAX);
}
break;
case GTOK_BAD_QSTRING:
- sprintf(ErrorMsg,
- "expecting \'=\', found unterminated string \"%s",
- value);
+ snprintf(ErrorMsg, sizeof(ErrorMsg),
+ "expecting \'=\', found unterminated string \"%s",
+ value);
return(KV_SYNTAX);
case GTOK_PUNK:
gotit = TRUE;
} else {
if (strcmp("\n",value)==0) {
- sprintf(ErrorMsg,"expecting \"=\", found newline");
+ snprintf(ErrorMsg, sizeof(ErrorMsg),
+ "expecting \"=\", found newline");
fUngetChar('\n',fp);
} else {
- sprintf(ErrorMsg,
- "expecting rvalue, found \'%s\'",keyword);
+ snprintf(ErrorMsg, sizeof(ErrorMsg),
+ "expecting rvalue, found \'%s\'",keyword);
}
return(KV_SYNTAX);
}
case GTOK_STRING:
case GTOK_QSTRING:
case GTOK_NUMBER:
- sprintf(ErrorMsg,"expecting \'=\', found \"%s\"",value);
+ snprintf(ErrorMsg, sizeof(ErrorMsg),
+ "expecting \'=\', found \"%s\"", value);
return(KV_SYNTAX);
case GTOK_EOF:
- sprintf(ErrorMsg,"expecting \'=\', found EOF");
+ snprintf(ErrorMsg, sizeof(ErrorMsg), "expecting \'=\', found EOF");
return(KV_SYNTAX);
default:
- sprintf(ErrorMsg,
- "panic: bad return (%d) from fGetToken()",rc);
+ snprintf(ErrorMsg, sizeof(ErrorMsg),
+ "panic: bad return (%d) from fGetToken()",rc);
return(KV_SYNTAX);
}
break;
case GTOK_EOF:
- sprintf(ErrorMsg,"expecting rvalue, found EOF");
+ snprintf(ErrorMsg, sizeof(ErrorMsg), "expecting rvalue, found EOF");
return(KV_SYNTAX);
case GTOK_BAD_QSTRING:
- sprintf(ErrorMsg,"unterminated quoted string \"%s",value);
+ snprintf(ErrorMsg, sizeof(ErrorMsg),
+ "unterminated quoted string \"%s", value);
return(KV_SYNTAX);
case GTOK_PUNK:
if (strcmp("\n",value)==0) {
- sprintf(ErrorMsg,"expecting rvalue, found newline");
+ snprintf(ErrorMsg, sizeof(ErrorMsg),
+ "expecting rvalue, found newline");
fUngetChar('\n',fp);
} else {
- sprintf(ErrorMsg,
- "expecting rvalue, found \'%s\'",value);
+ snprintf(ErrorMsg, sizeof(ErrorMsg),
+ "expecting rvalue, found \'%s\'",value);
}
return(KV_SYNTAX);
break;
return(KV_OKAY);
default:
- sprintf(ErrorMsg,
- "panic: bad return (%d) from fGetToken()",rc);
+ snprintf(ErrorMsg, sizeof(ErrorMsg),
+ "panic: bad return (%d) from fGetToken()",rc);
return(KV_SYNTAX);
}
when /= 60;
hours = when%24;
when /= 24;
- sprintf(atime, "%d+%02d:%02d:%02d", (int)when, hours, mins, secs);
+ snprintf(atime, sizeof(atime), "%d+%02d:%02d:%02d", (int)when, hours,
+ mins, secs);
return(atime);
}
#ifdef ATHENA_COMPAT
/* this is only for compatibility with old servers */
if (options & KOPT_DO_OLDSTYLE) {
- (void) sprintf(buf,"%d ",ticket->length);
+ (void) snprintf(buf, sizeof(buf), "%d ", ticket->length);
(void) write(fd, buf, strlen(buf));
(void) write(fd, (char *) ticket->dat, ticket->length);
return(rem);
} else {
/* 32 bits of signed integer will always fit in 11 characters
(including the sign), so no need to worry about overflow */
- (void) sprintf(krb_ticket_string, "%s%d",TKT_ROOT,(int)getuid());
+ (void) snprintf(krb_ticket_string, sizeof(krb_ticket_string),
+ "%s%d", TKT_ROOT, (int)getuid());
}
}
return krb_ticket_string;
-/* $Id: ksrvutil.c,v 1.2 1995/12/14 08:43:56 tholo Exp $ */
+/* $Id: ksrvutil.c,v 1.3 1996/09/16 18:49:03 millert Exp $ */
/*-
* Copyright (C) 1989 by the Massachusetts Institute of Technology
(void) bzero((char *)backup_keyfile, sizeof(backup_keyfile));
(void) bzero((char *)local_realm, sizeof(local_realm));
- (void) sprintf(change_tkt, "/tmp/tkt_ksrvutil.%d", (int)getpid());
+ (void) snprintf(change_tkt, sizeof(change_tkt), "/tmp/tkt_ksrvutil.%d",
+ (int)getpid());
krb_set_tkt_string(change_tkt);
/* This is used only as a default for adding keys */
-/* $Id: make_keypair.c,v 1.2 1995/12/29 09:49:55 tholo Exp $ */
+/* $Id: make_keypair.c,v 1.3 1996/09/16 18:49:04 millert Exp $ */
/*-
* Copyright (c) 1988, 1993
char namebuf[255];
int fd;
- (void)sprintf(namebuf, "%s",
- inet_ntoa(addr));
+ (void)snprintf(namebuf, sizeof(namebuf), "%s", inet_ntoa(addr));
fd = open(namebuf, O_WRONLY|O_CREAT, 0600);
if (fd < 0) {
perror("open");
-/* $Id: utils.c,v 1.1.1.1 1995/12/14 06:52:48 tholo Exp $ */
+/* $Id: utils.c,v 1.2 1996/09/16 18:49:05 millert Exp $ */
/*-
* Copyright 1987, 1988 by MIT Student Information Processing Board
size += strlen(var_name)+7; /* "quux, " */
size += strlen(func_name)+7; /* "foo, " */
size += strlen(info_string)+9; /* "\"Info!\", " */
- sprintf(numbuf, "%d", options);
+ snprintf(numbuf, sizeof(numbuf), "%d", options);
size += strlen(numbuf);
size += 4; /* " }," + NL */
string = malloc(size * sizeof(char *));
-/* $Id: register.c,v 1.3 1996/09/04 05:10:23 deraadt Exp $ */
+/* $Id: register.c,v 1.4 1996/09/16 18:49:06 millert Exp $ */
/*-
* Copyright (c) 1989, 1993
char namebuf[MAXPATHLEN];
extern int errno;
- (void) sprintf(namebuf, "%s%s",
- CLIENT_KEYFILE,
- inet_ntoa(local.sin_addr));
+ (void) snprintf(namebuf, sizeof(namebuf), "%s%s", CLIENT_KEYFILE,
+ inet_ntoa(local.sin_addr));
fd = open(namebuf, O_RDONLY);
if (fd < 0) {
-/* $Id: registerd.c,v 1.3 1996/04/17 07:23:35 tholo Exp $ */
+/* $Id: registerd.c,v 1.4 1996/09/16 18:49:07 millert Exp $ */
/*-
* Copyright (c) 1990, 1993
/* get encryption key */
- (void) sprintf(keyfile, "%s/%s",
- SERVER_KEYDIR,
- inet_ntoa(sina.sin_addr));
+ (void) snprintf(keyfile, sizeof(keyfile), "%s/%s",
+ SERVER_KEYDIR, inet_ntoa(sina.sin_addr));
if ((kf = open(keyfile, O_RDONLY)) < 0) {
syslog(LOG_ERR,
"error opening Kerberos update keyfile (%s): %m", keyfile);
- (void) sprintf(msgbuf,
- "couldn't open session keyfile for your host");
+ (void) snprintf(msgbuf, sizeof(msgbuf),
+ "couldn't open session keyfile for your host");
send_packet(msgbuf, CLEAR);
exit(1);
}
if (read(kf, keybuf, KBUFSIZ) != KBUFSIZ) {
syslog(LOG_ERR, "wrong read size of Kerberos update keyfile");
- (void) sprintf(msgbuf,
+ (void) snprintf(msgbuf, sizeof(msgbuf),
"couldn't read session key from your host's keyfile");
send_packet(msgbuf, CLEAR);
exit(1);
}
- (void) sprintf(msgbuf, GOTKEY_MSG);
+ (void) snprintf(msgbuf, sizeof(msgbuf), GOTKEY_MSG);
send_packet(msgbuf, CLEAR);
kfile = (struct keyfile_data *) keybuf;
key_sched(&kfile->kf_key, schedule);
code = (u_char) retval;
if (code != KSUCCESS) {
- (void) sprintf(msgbuf, "%s", krb_err_txt[code]);
+ (void) snprintf(msgbuf, sizeof(msgbuf), "%s",
+ krb_err_txt[code]);
send_packet(msgbuf, RCRYPT);
} else {
- (void) sprintf(msgbuf, "Update complete.");
+ (void) snprintf(msgbuf, sizeof(msgbuf), "Update complete.");
send_packet(msgbuf, RCRYPT);
}
cleanup();
-/* $Id: help.c,v 1.1.1.1 1995/12/14 06:52:47 tholo Exp $ */
+/* $Id: help.c,v 1.2 1996/09/16 18:49:08 millert Exp $ */
/*-
* Copyright 1987, 1988 by the Student Information Processing Board
}
else if (argc != 2) {
/* should do something better than this */
- sprintf(buffer, "usage:\n\t%s [topic|command]\nor\t%s\n",
- request_name, request_name);
+ snprintf(buffer, sizeof(buffer),
+ "usage:\n\t%s [topic|command]\nor\t%s\n",
+ request_name, request_name);
ss_perror(sci_idx, 0, buffer);
return;
}