-/* $OpenBSD: eehandlers.c,v 1.4 1996/08/31 12:42:49 deraadt Exp $ */
+/* $OpenBSD: eehandlers.c,v 1.5 1996/08/31 12:56:06 deraadt Exp $ */
/* $NetBSD: eehandlers.c,v 1.2 1996/02/28 01:13:22 thorpej Exp $ */
/*-
fd = open(path_eeprom, wr == IO_WRITE ? O_RDWR : O_RDONLY, 0640);
if (fd < 0) {
- sprintf(err_str, "open: %s: %s", path_eeprom,
+ snprintf(err_str, sizeof err_str, "open: %s: %s", path_eeprom,
strerror(errno));
free(buf2);
return (1);
}
if (lseek(fd, (off_t)ktent->kt_offset, SEEK_SET) < (off_t)0) {
- sprintf(err_str, "lseek: %s:", path_eeprom,
+ snprintf(err_str, sizeof err_str, "lseek: %s: %s", path_eeprom,
strerror(errno));
rval = 1;
goto done;
}
if (read(fd, buf2, len) != len) {
- sprintf(err_str, "read: %s: %s", path_eeprom,
- strerror(errno));
+ snprintf(err_str, sizeof err_str, "read: %s: %s", path_eeprom,
+ strerror(errno));
return (1);
}
goto done;
if (lseek(fd, (off_t)ktent->kt_offset, SEEK_SET) < (off_t)0) {
- sprintf(err_str, "lseek: %s: %s", path_eeprom,
- strerror(errno));
+ snprintf(err_str, sizeof err_str, "lseek: %s: %s",
+ path_eeprom, strerror(errno));
rval = 1;
goto done;
}
++update_checksums;
if (write(fd, buf, len) < 0) {
- sprintf(err_str, "write: %s: %s", path_eeprom,
- strerror(errno));
+ snprintf(err_str, sizeof err_str, "write: %s: %s",
+ path_eeprom, strerror(errno));
rval = 1;
goto done;
}
-/* $OpenBSD: ophandlers.c,v 1.2 1996/03/25 15:55:22 niklas Exp $ */
+/* $OpenBSD: ophandlers.c,v 1.3 1996/08/31 12:56:08 deraadt Exp $ */
/* $NetBSD: ophandlers.c,v 1.2 1996/02/28 01:13:30 thorpej Exp $ */
/*-
};
#define BARF(str1, str2) { \
- sprintf(err_str, "%s: %s", (str1), (str2)); \
+ snprintf(err_str, sizeof err_str "%s: %s", (str1), (str2)); \
++eval; \
return (err_str); \
};
BARF("OPIOCGET", strerror(errno));
if (opio.op_buflen <= 0) {
- sprintf(err_str, "nothing available for %s",
+ snprintf(err_str, sizeof err_str,
+ "nothing available for %s",
keyword);
return (err_str);
}