From 43c53abb4a702a51e62f98609eacbcf9ea5c22f6 Mon Sep 17 00:00:00 2001 From: notaz Date: Sun, 15 Mar 2009 16:26:43 +0000 Subject: [PATCH] minor adjustments --- mx/linux/sms2mx.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mx/linux/sms2mx.c b/mx/linux/sms2mx.c index 2dd4292..6b084ea 100644 --- a/mx/linux/sms2mx.c +++ b/mx/linux/sms2mx.c @@ -1,8 +1,9 @@ #include #include -#define IN_SIZE 0x8000 -static unsigned char buff[0x400000], buff_in[IN_SIZE]; +#define IN_SIZE 0x8000 +#define OUT_SIZE 0x400000 +static unsigned char buff[OUT_SIZE], buff_in[IN_SIZE]; int main(int argc, char *argv[]) { @@ -44,10 +45,10 @@ int main(int argc, char *argv[]) for (bsize = 1; bsize < size; bsize <<= 1) ; - for (i = 0, o = 0; o < sizeof(buff); i = (i + 1) & (bsize - 1), o += 2) - buff[o] = buff[o+1] = buff_in[i]; + for (i = o = 0; o < sizeof(buff); i = (i + 1) & (bsize - 1), o += 2) + buff[o+1] = buff_in[i]; - if (fwrite(buff, 1, 0x400000, fo) != 0x400000) + if (fwrite(buff, 1, OUT_SIZE, fo) != OUT_SIZE) fprintf(stderr, "failed to write to %s\n", argv[2]); fclose(fi); fclose(fo); -- 2.39.5