[hackers] [sbase] Don't forget to scale in parseoffset() || FRIGN

From: <git_AT_suckless.org>
Date: Wed, 30 Sep 2015 20:44:18 +0200 (CEST)

commit 64929039e99bebc1c0109be31751f69cafc8536f
Author: FRIGN <dev_AT_frign.de>
AuthorDate: Wed Sep 30 01:26:27 2015 +0200
Commit: sin <sin_AT_2f30.org>
CommitDate: Wed Sep 30 19:44:10 2015 +0100

    Don't forget to scale in parseoffset()

diff --git a/libutil/parseoffset.c b/libutil/parseoffset.c
index 451d913..9ce0411 100644
--- a/libutil/parseoffset.c
+++ b/libutil/parseoffset.c
_AT_@ -10,7 +10,7 @@ off_t
 parseoffset(const char *str)
 {
         off_t res;
- size_t scale;
+ size_t scale = 1;
         int base = 10;
         char *end;
 
_AT_@ -55,5 +55,5 @@ parseoffset(const char *str)
                 return -1;
         }
 
- return res;
+ return res * scale;
 }
Received on Wed Sep 30 2015 - 20:44:18 CEST

This archive was generated by hypermail 2.3.0 : Wed Sep 30 2015 - 20:48:31 CEST