diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2014-12-18 02:58:35 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2014-12-18 02:58:35 +0000 |
commit | b19b3e0682d6e224c12b35308772114fe27372fe (patch) | |
tree | bb4e1a89cdb4b3e64cc6df528ce1b7105cd5fb18 /src | |
parent | 2deda8e0d1f7a58f6468d31e0202d63bfbd3b99e (diff) | |
download | skalibs-b19b3e0682d6e224c12b35308772114fe27372fe.tar.xz |
Fix timed_getlnmax: correctly update w
Diffstat (limited to 'src')
-rw-r--r-- | src/libunixonacid/timed_getlnmax.c | 6 |
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 ; } |