summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/log/log.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/log/log.c b/src/log/log.c
index 3939d41..28218d2 100644
--- a/src/log/log.c
+++ b/src/log/log.c
@@ -582,25 +582,25 @@ static void map_placeholders_to_strings( char **msg_arr,
const char *c;
int field;
int i;
+ int size;
+ char *s;
for( c = format, field = 0; *c != '\0'; c++ ) {
if( *c == '%' && *(c+1) != '%' ) {
switch( *(c+1) ) {
case 'd':
- msg_arr[field] = "int param";
- field++;
-/* i = va_arg( ap, int );
+ i = va_arg( ap, int );
msg_arr[field] = (char *)malloc( 20 );
snprintf( msg_arr[field], 20, "%d", i );
-*/ break;
+ field++;
+ break;
case 's':
- msg_arr[field] = "string param";
+ s = va_arg( ap, char * );
+ msg_arr[field] = (char *)malloc( 512 );
+ snprintf( msg_arr[field], 512, "%s", s );
field++;
-/* i = va_arg( ap, int );
- msg_arr[field] = (char *)malloc( 20 );
- snprintf( msg_arr[field], 20, "%d", i );
-*/ break;
+ break;
}
c++;
}