diff options
author | Gilles Moris <gilles.moris@free.fr> | 2019-05-19 16:10:16 +0200 |
---|---|---|
committer | Gilles Moris <gilles.moris@med.ge.com> | 2019-05-20 12:33:14 +0200 |
commit | 6a2b5acdcf9511bf3b50508910b718e369a028f1 (patch) | |
tree | 3c4d0271c9f2f7be0c2ed8c1843f307d1d2febf8 /support.cc | |
parent | f9d08a6b6bf0bae229f45eeebeeacc64d4369151 (diff) | |
download | sgdisk-6a2b5acdcf9511bf3b50508910b718e369a028f1.tar.gz |
Use PRIu64 macro to have a portable way to scan in uint64_t
Diffstat (limited to 'support.cc')
-rw-r--r-- | support.cc | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -8,7 +8,9 @@ #define __STDC_LIMIT_MACROS #define __STDC_CONSTANT_MACROS +#define __STDC_FORMAT_MACROS +#include <inttypes.h> #include <stdio.h> #include <stdint.h> #include <errno.h> @@ -79,7 +81,7 @@ uint64_t GetNumber(uint64_t low, uint64_t high, uint64_t def, const string & pro cin.getline(line, 255); if (!cin.good()) exit(5); - num = sscanf(line, "%lld", &response); + num = sscanf(line, "%" PRIu64, &response); if (num == 1) { // user provided a response if ((response < low) || (response > high)) cout << "Value out of range\n"; |