/[jscoverage]/trunk/util.c
ViewVC logotype

Diff of /trunk/util.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 125 by siliconforks, Mon Jun 2 17:52:38 2008 UTC revision 311 by siliconforks, Mon Oct 13 17:51:29 2008 UTC
# Line 47  Line 47 
47    vfprintf(stderr, format, ap);    vfprintf(stderr, format, ap);
48    va_end(ap);    va_end(ap);
49    fputc('\n', stderr);    fputc('\n', stderr);
50      exit(EXIT_FAILURE);
51    }
52    
53    void fatal_command_line(const char * format, ...) {
54      fprintf(stderr, "%s: ", program);
55      va_list ap;
56      va_start(ap, format);
57      vfprintf(stderr, format, ap);
58      va_end(ap);
59      fputc('\n', stderr);
60    fprintf(stderr, "Try `%s --help' for more information.\n", program);    fprintf(stderr, "Try `%s --help' for more information.\n", program);
61    exit(EXIT_FAILURE);    exit(EXIT_FAILURE);
62  }  }
63    
64    void version(void) {
65      printf("%s %s\n", program, VERSION);
66      printf("Character encoding support: ");
67    #if HAVE_ICONV
68      printf("iconv\n");
69    #elif HAVE_MULTIBYTETOWIDECHAR
70      printf("MultiByteToWideChar\n");
71    #else
72      printf("none\n");
73    #endif
74      exit(EXIT_SUCCESS);
75    }
76    
77  size_t addst(size_t x, size_t y) {  size_t addst(size_t x, size_t y) {
78    if (SIZE_MAX - x < y) {    if (SIZE_MAX - x < y) {
79      fatal("integer overflow");      fatal("integer overflow");

Legend:
Removed from v.125  
changed lines
  Added in v.311

  ViewVC Help
Powered by ViewVC 1.1.24