summaryrefslogtreecommitdiff
path: root/src/libunixonacid
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2014-12-18 02:58:35 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2014-12-18 02:58:35 +0000
commitb19b3e0682d6e224c12b35308772114fe27372fe (patch)
treebb4e1a89cdb4b3e64cc6df528ce1b7105cd5fb18 /src/libunixonacid
parent2deda8e0d1f7a58f6468d31e0202d63bfbd3b99e (diff)
downloadskalibs-b19b3e0682d6e224c12b35308772114fe27372fe.tar.xz
Fix timed_getlnmax: correctly update w
Diffstat (limited to 'src/libunixonacid')
-rw-r--r--src/libunixonacid/timed_getlnmax.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libunixonacid/timed_getlnmax.c b/src/libunixonacid/timed_getlnmax.c
index 8953606..2a8fab3 100644
--- a/src/libunixonacid/timed_getlnmax.c
+++ b/src/libunixonacid/timed_getlnmax.c
@@ -28,6 +28,8 @@ static int get (struct blah_s *blah)
int timed_getlnmax (buffer *b, char *d, unsigned int max, unsigned int *w, char sep, tain_t const *deadline, tain_t *stamp)
{
- struct blah_s blah = { .b = b, .d = d, .max = max, .w = 0, .sep = sep } ;
- return timed_get(&blah, (initfunc_t_ref)&getfd, (initfunc_t_ref)&get, deadline, stamp) ;
+ struct blah_s blah = { .b = b, .d = d, .max = max, .w = *w, .sep = sep } ;
+ register int r = timed_get(&blah, (initfunc_t_ref)&getfd, (initfunc_t_ref)&get, deadline, stamp) ;
+ *w = blah.w ;
+ return r ;
}