diff options
author | HimbeerserverDE <himbeerserverde@gmail.com> | 2022-04-24 21:52:59 +0200 |
---|---|---|
committer | HimbeerserverDE <himbeerserverde@gmail.com> | 2022-04-24 21:52:59 +0200 |
commit | 58ec0a557b08638c3a5b5547f05d087c71f4d437 (patch) | |
tree | e6e3e6275fdff8a2e71b82e253900d32b955f515 | |
parent | 750b25871dae2ff69ca35c3c8d83ba548b8ac5fb (diff) |
Turn lprintf into vlprintf for future extensibility
-rw-r--r-- | clog.c | 8 | ||||
-rw-r--r-- | clog.h | 4 |
2 files changed, 4 insertions, 8 deletions
@@ -1,4 +1,3 @@ -#include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -7,11 +6,8 @@ #define TIMESTRLEN 20 -int lprintf(const char *format, ...) +int vlprintf(const char *format, va_list ap) { - va_list ap; - va_start(ap, format); - time_t timer = time(NULL); struct tm *tm_info = localtime(&timer); @@ -29,7 +25,5 @@ int lprintf(const char *format, ...) strcat(fmt, "\n"); n += vprintf(format, ap); - - va_end(ap); return n; } @@ -1,6 +1,8 @@ #ifndef _CLOG_H_ #define _CLOG_H_ -int lprintf(const char *format, ...); +#include <stdarg.h> + +int vlprintf(const char *format, va_list ap); #endif |