Skip to content

Commit

Permalink
Reformated source files with indent
Browse files Browse the repository at this point in the history
* Remove hard tabs and reformat the sources to the Kernighan & Ritchie
  style. It is used throughout their well-known book
  The C Programming Language.

  Used command line:
  $ indent -kr -nut <file>.c
  • Loading branch information
mattthias committed Apr 22, 2017
1 parent 8a344ab commit 63a1aa0
Show file tree
Hide file tree
Showing 11 changed files with 1,149 additions and 1,242 deletions.
55 changes: 27 additions & 28 deletions error.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,34 +21,33 @@

void error(int level, char *msg, ...)
{
va_list arguments;
int debug = 1;
va_start(arguments, msg);
va_list arguments;
int debug = 1;
va_start(arguments, msg);

switch (level)
{
case ERR_DEBUG:
if (debug != 0)
fprintf(stderr, "DEBUG: ");
break;
case ERR_NOTICE:
fprintf(stderr, "NOTICE: ");
break;
case ERR_WARNING:
fprintf(stderr, "WARNING: ");
break;
case ERR_ERROR:
fprintf(stderr, "ERROR: ");
break;
case ERR_FATAL:
fprintf(stderr, "FATAL: ");
break;
}
/* print the remaining arguments */
vfprintf(stderr, msg, arguments);
va_end(arguments);
fprintf(stderr, "\n");
if (level == ERR_FATAL)
exit(1);
switch (level) {
case ERR_DEBUG:
if (debug != 0)
fprintf(stderr, "DEBUG: ");
break;
case ERR_NOTICE:
fprintf(stderr, "NOTICE: ");
break;
case ERR_WARNING:
fprintf(stderr, "WARNING: ");
break;
case ERR_ERROR:
fprintf(stderr, "ERROR: ");
break;
case ERR_FATAL:
fprintf(stderr, "FATAL: ");
break;
}
/* print the remaining arguments */
vfprintf(stderr, msg, arguments);
va_end(arguments);
fprintf(stderr, "\n");
if (level == ERR_FATAL)
exit(1);
}
#endif
Loading

0 comments on commit 63a1aa0

Please sign in to comment.