~ubuntu-branches/ubuntu/lucid/curl/lucid-201101212007

« back to all changes in this revision

Viewing changes to docs/examples/debug.c

  • Committer: Kees Cook
  • Date: 2009-12-12 04:16:02 UTC
  • mfrom: (3.3.3 squeeze)
  • Revision ID: kees@outflux.net-20091212041602-o707x164tp1f8efj
Merged with Debian testing

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 *                            | (__| |_| |  _ <| |___
6
6
 *                             \___|\___/|_| \_\_____|
7
7
 *
8
 
 * $Id: debug.c,v 1.4 2008-05-22 21:20:09 danf Exp $
 
8
 * $Id: debug.c,v 1.5 2009-06-05 18:40:40 yangtse Exp $
9
9
 */
10
10
 
11
11
#include <stdio.h>
29
29
    /* without the hex output, we can fit more on screen */
30
30
    width = 0x40;
31
31
 
32
 
  fprintf(stream, "%s, %zd bytes (0x%zx)\n", text, size, size);
 
32
  fprintf(stream, "%s, %010.10ld bytes (0x%08.8lx)\n",
 
33
          text, (long)size, (long)size);
33
34
 
34
35
  for(i=0; i<size; i+= width) {
35
36
 
36
 
    fprintf(stream, "%04zx: ", i);
 
37
    fprintf(stream, "%04.4lx: ", (long)i);
37
38
 
38
39
    if(!nohex) {
39
40
      /* hex not disabled, show it */