summaryrefslogtreecommitdiff
path: root/lib/formats.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-06-07 11:29:16 +0300
committerPanu Matilainen <pmatilai@redhat.com>2008-06-07 11:29:16 +0300
commitbe712bc960fe8a75fc55e724b1e7d4980281eeb1 (patch)
tree01fe71b83445dbc2c6fba19688bb526b03fe9acf /lib/formats.c
parent3d8e8c5e53ca60817395164b1e08593da82cd2da (diff)
downloadlibrpm-tizen-be712bc960fe8a75fc55e724b1e7d4980281eeb1.tar.gz
librpm-tizen-be712bc960fe8a75fc55e724b1e7d4980281eeb1.tar.bz2
librpm-tizen-be712bc960fe8a75fc55e724b1e7d4980281eeb1.zip
Use inttypes.h formats in stringFormat()
- add 64bit type while at it
Diffstat (limited to 'lib/formats.c')
-rw-r--r--lib/formats.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/formats.c b/lib/formats.c
index 30f64ad15..dee081687 100644
--- a/lib/formats.c
+++ b/lib/formats.c
@@ -4,6 +4,8 @@
#include "system.h"
+#include <inttypes.h>
+
#include <rpm/rpmtypes.h>
#include <rpm/rpmtd.h>
#include <rpm/rpmds.h>
@@ -45,17 +47,21 @@ static char * stringFormat(rpmtd td, char *formatPrefix)
switch (rpmtdType(td)) {
case RPM_INT8_TYPE:
case RPM_CHAR_TYPE:
- strcat(formatPrefix, "hhu");
+ strcat(formatPrefix, PRIu8);
rasprintf(&val, formatPrefix, *rpmtdGetChar(td));
break;
case RPM_INT16_TYPE:
- strcat(formatPrefix, "hu");
+ strcat(formatPrefix, PRIu16);
rasprintf(&val, formatPrefix, *rpmtdGetUint16(td));
break;
case RPM_INT32_TYPE:
- strcat(formatPrefix, "u");
+ strcat(formatPrefix, PRIu32);
rasprintf(&val, formatPrefix, *rpmtdGetUint32(td));
break;
+ case RPM_INT64_TYPE:
+ strcat(formatPrefix, PRIu64);
+ rasprintf(&val, formatPrefix, *rpmtdGetUint64(td));
+ break;
case RPM_STRING_TYPE:
case RPM_STRING_ARRAY_TYPE:
case RPM_I18NSTRING_TYPE: