HaikuDepot: notify work status from main window
[haiku.git] / src / tools / misc / bin2h.c
blobf2decae232ba144e69f7e96666cf8972d89339dd
1 /*
2 ** Copyright 2001, Travis Geiselbrecht. All rights reserved.
3 ** Distributed under the terms of the NewOS License.
4 */
5 #include <stdio.h>
6 #include <stdlib.h>
8 #define NUM_COLUMNS 16
10 int main(int argc, char **argv)
12 FILE *infp = stdin;
13 char c;
14 int column = 0;
16 while(!feof(infp)) {
17 int err;
18 err = fread(&c, sizeof(c), 1, infp);
19 if(err != 1)
20 break;
22 printf("0x%02x,", ((int)c) & 0xff);
23 if((++column % NUM_COLUMNS) == 0) {
24 printf("\n");
28 return 0;