diff options
author | brian <brian@FreeBSD.org> | 2001-08-20 13:24:39 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2001-08-20 13:24:39 +0000 |
commit | d48c427cd5bdebd62fe29b534bab868f697332da (patch) | |
tree | cfffe027302e0b8a140748c6626dc30e92913ec1 /usr.sbin/apmd | |
parent | 016b1a255a4619a8b85d12e8ef931c0dfa1e13ae (diff) | |
download | FreeBSD-src-d48c427cd5bdebd62fe29b534bab868f697332da.zip FreeBSD-src-d48c427cd5bdebd62fe29b534bab868f697332da.tar.gz |
Handle snprintf() returning -1.
MFC after: 2 weeks
Diffstat (limited to 'usr.sbin/apmd')
-rw-r--r-- | usr.sbin/apmd/contrib/pccardq.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/apmd/contrib/pccardq.c b/usr.sbin/apmd/contrib/pccardq.c index 2bace22..1c551a1 100644 --- a/usr.sbin/apmd/contrib/pccardq.c +++ b/usr.sbin/apmd/contrib/pccardq.c @@ -164,7 +164,11 @@ get_slot_info(int so, int slot, char **manuf, char **version, char char *_version; char *_device; - slen = snprintf(buf, sizeof buf, "N%d", slot); + if ((slen = snprintf(buf, sizeof buf, "N%d", slot)) == -1) { + warnc(0, "write"); + goto err; + } + if ((rv = write(so, buf, slen)) < 0) { warn("write"); goto err; |