[BACK]Return to compat_err.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/compat_err.c between version 1.1 and 1.4

version 1.1, 2015/10/11 21:12:54 version 1.4, 2015/11/26 07:42:11
Line 36  int dummy;
Line 36  int dummy;
  * SUCH DAMAGE.   * SUCH DAMAGE.
  */   */
   
 #include <err.h>  
 #include <errno.h>  #include <errno.h>
 #include <stdarg.h>  #include <stdarg.h>
 #include <stdio.h>  #include <stdio.h>
 #include <stdlib.h>  #include <stdlib.h>
 #include <string.h>  #include <string.h>
   
 extern char *__progname;  
   
 static void vwarni(const char *, va_list);  static void vwarni(const char *, va_list);
 static void vwarnxi(const char *, va_list);  static void vwarnxi(const char *, va_list);
   
 static void  static void
 vwarnxi(const char *fmt, va_list ap)  vwarnxi(const char *fmt, va_list ap)
 {  {
         fprintf(stderr, "%s: ", __progname);          fprintf(stderr, "%s: ", getprogname());
         if (fmt != NULL)          if (fmt != NULL)
                 vfprintf(stderr, fmt, ap);                  vfprintf(stderr, fmt, ap);
 }  }
Line 76  err(int eval, const char *fmt, ...)
Line 73  err(int eval, const char *fmt, ...)
         va_start(ap, fmt);          va_start(ap, fmt);
         vwarni(fmt, ap);          vwarni(fmt, ap);
         va_end(ap);          va_end(ap);
           exit(eval);
   }
   
   void
   errx(int eval, const char *fmt, ...)
   {
           va_list ap;
   
           va_start(ap, fmt);
           vwarnxi(fmt, ap);
           va_end(ap);
           fputc('\n', stderr);
         exit(eval);          exit(eval);
 }  }
   

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.4

CVSweb