Hex.c 549 B

12345678910111213141516
  1. /* -*- mode:c; c-file-style:"k&r"; c-basic-offset: 4; tab-width:4; indent-tabs-mode:nil; mode:auto-fill; fill-column:78; -*- */
  2. /* vim: set ts=4 sw=4 et tw=78 fo=cqt wm=0: */
  3. #include "pal.h"
  4. #include "pal_debug.h"
  5. #include "api.h"
  6. #include "hex.h"
  7. int main() {
  8. char x[] = {0xde, 0xad, 0xbe, 0xef};
  9. char y[] = {0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd};
  10. char buf[(sizeof(y) * 2) + 1];
  11. pal_printf("Hex test 1 is %s\n", bytes2hexstr(x, buf, 17));
  12. pal_printf("Hex test 2 is %s\n", bytes2hexstr(y, buf, 17));
  13. return 0;
  14. }