comparison dbutil.c @ 299:740e782679be ucc-axis-hack

Various changes to compile+kind of run on UCC's axis board. Note that fprintf(stdin -> printf( accounts for many of the changes
author Matt Johnston <matt@ucc.asn.au>
date Sat, 25 Mar 2006 12:57:09 +0000
parents 306499676384
children 973fccb59ea4
comparison
equal deleted inserted replaced
266:e37b160c414c 299:740e782679be
119 119
120 char printbuf[1024]; 120 char printbuf[1024];
121 121
122 vsnprintf(printbuf, sizeof(printbuf), format, param); 122 vsnprintf(printbuf, sizeof(printbuf), format, param);
123 123
124 fprintf(stderr, "%s\n", printbuf); 124 printf( "%s\n", printbuf);
125 125
126 } 126 }
127 127
128 /* this is what can be called to write arbitrary log messages */ 128 /* this is what can be called to write arbitrary log messages */
129 void dropbear_log(int priority, const char* format, ...) { 129 void dropbear_log(int priority, const char* format, ...) {
144 if (!debug_trace) { 144 if (!debug_trace) {
145 return; 145 return;
146 } 146 }
147 147
148 va_start(param, format); 148 va_start(param, format);
149 fprintf(stderr, "TRACE: "); 149 printf( "TRACE: ");
150 vfprintf(stderr, format, param); 150 vprintf( format, param);
151 fprintf(stderr, "\n"); 151 printf( "\n");
152 va_end(param); 152 va_end(param);
153 //usleep(100000);
153 } 154 }
154 #endif /* DEBUG_TRACE */ 155 #endif /* DEBUG_TRACE */
155 156
156 static void set_sock_priority(int sock) { 157 static void set_sock_priority(int sock) {
157 158
474 #ifdef DEBUG_TRACE 475 #ifdef DEBUG_TRACE
475 void printhex(const char * label, const unsigned char * buf, int len) { 476 void printhex(const char * label, const unsigned char * buf, int len) {
476 477
477 int i; 478 int i;
478 479
479 fprintf(stderr, "%s\n", label); 480 printf( "%s\n", label);
480 for (i = 0; i < len; i++) { 481 for (i = 0; i < len; i++) {
481 fprintf(stderr, "%02x", buf[i]); 482 printf( "%02x", buf[i]);
482 if (i % 16 == 15) { 483 if (i % 16 == 15) {
483 fprintf(stderr, "\n"); 484 printf( "\n");
484 } 485 }
485 else if (i % 2 == 1) { 486 else if (i % 2 == 1) {
486 fprintf(stderr, " "); 487 printf( " ");
487 } 488 }
488 } 489 }
489 fprintf(stderr, "\n"); 490 printf( "\n");
490 } 491 }
491 #endif 492 #endif
492 493
493 /* Strip all control characters from text (a null-terminated string), except 494 /* Strip all control characters from text (a null-terminated string), except
494 * for '\n', '\r' and '\t'. 495 * for '\n', '\r' and '\t'.