new function PUTX2 to display an int as an 8 bits hexadecimal

This commit is contained in:
Cedric Roux
2016-06-22 16:10:32 +02:00
parent bbcfd0047c
commit 088db3cf37
2 changed files with 8 additions and 0 deletions
+7
View File
@@ -190,6 +190,13 @@ void PUTI(OBUF *o, int i)
PUTS(o, s);
}
void PUTX2(OBUF *o, int i)
{
char s[64];
sprintf(s, "%2.2x", i);
PUTS(o, s);
}
void PUTUL(OBUF *o, unsigned long l)
{
char s[128];
+1
View File
@@ -44,6 +44,7 @@ void PUTC(OBUF *o, char c);
void PUTS(OBUF *o, char *s);
void PUTS_CLEAN(OBUF *o, char *s);
void PUTI(OBUF *o, int i);
void PUTX2(OBUF *o, int i);
void PUTUL(OBUF *o, unsigned long i);
#endif /* _UTILS_H_ */