From: dlg Date: Tue, 7 Jan 2014 00:11:11 +0000 (+0000) Subject: the return from asprintf does NOT include the space used by the X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c78ca77f70dfd60f3b580826cf45b8a4de4496ca;p=openbsd the return from asprintf does NOT include the space used by the terminating \0 character. if i want to use it as a c string i have to take that into account. found by simon kuhnle who supplied a good bug report. prodded by deraadt@ --- diff --git a/usr.sbin/identd/identd.c b/usr.sbin/identd/identd.c index 0cfef24baa6..6e628e8df34 100644 --- a/usr.sbin/identd/identd.c +++ b/usr.sbin/identd/identd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: identd.c,v 1.23 2013/11/21 03:09:07 dlg Exp $ */ +/* $OpenBSD: identd.c,v 1.24 2014/01/07 00:11:11 dlg Exp $ */ /* * Copyright (c) 2013 David Gwynne @@ -395,7 +395,7 @@ parent_rd(int fd, short events, void *arg) goto done; } - r->buflen = n; + r->buflen = n + 1; done: SIMPLEQ_INSERT_TAIL(&sc.parent.replies, r, entry);