From: Sergey Poznyakoff Date: Tue, 2 Mar 2004 09:34:06 +0000 (+0000) Subject: (rmt_lseek__,rmt_ioctl__): Bugfix. The X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=9f14fd52de8a1974aae93000bed5c2deb5b11871;p=chaz%2Ftar (rmt_lseek__,rmt_ioctl__): Bugfix. The conversion buffer was not null terminated. Fix provided by Leland Lucius --- diff --git a/src/rtapelib.c b/src/rtapelib.c index dcf2477..1e04429 100644 --- a/src/rtapelib.c +++ b/src/rtapelib.c @@ -605,6 +605,7 @@ rmt_lseek__ (int handle, off_t offset, int whence) uintmax_t u = offset < 0 ? - (uintmax_t) offset : (uintmax_t) offset; char *p = operand_buffer + sizeof operand_buffer; + *--p = 0; do *--p = '0' + (int) (u % 10); while ((u /= 10) != 0); @@ -648,6 +649,7 @@ rmt_ioctl__ (int handle, int operation, char *argument) : (uintmax_t) ((struct mtop *) argument)->mt_count); char *p = operand_buffer + sizeof operand_buffer; + *--p = 0; do *--p = '0' + (int) (u % 10); while ((u /= 10) != 0);