summaryrefslogtreecommitdiffstats
path: root/src/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/utils.c b/src/utils.c
index 5b0872d..3c08351 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -20,7 +20,10 @@
20 */ 20 */
21#include <stdarg.h> 21#include <stdarg.h>
22#include <stdio.h> 22#include <stdio.h>
23#include <stdint.h>
24
23#include "utils.h" 25#include "utils.h"
26#include "libiphone/libiphone.h"
24 27
25int toto_debug = 0; 28int toto_debug = 0;
26uint16_t dbg_mask = 0; 29uint16_t dbg_mask = 0;
@@ -31,7 +34,7 @@ uint16_t dbg_mask = 0;
31 * 34 *
32 * @param level Set to 0 for no debugging or 1 for debugging. 35 * @param level Set to 0 for no debugging or 1 for debugging.
33 */ 36 */
34void iphone_set_debug(int level) 37void iphone_set_debug_level(int level)
35{ 38{
36 toto_debug = level; 39 toto_debug = level;
37} 40}
@@ -116,13 +119,12 @@ inline void log_debug_buffer(const char *data, const int length)
116inline void dump_debug_buffer(const char *file, const char *data, const int length) 119inline void dump_debug_buffer(const char *file, const char *data, const int length)
117{ 120{
118#ifndef STRIP_DEBUG_CODE 121#ifndef STRIP_DEBUG_CODE
119
120 /* run the real fprintf */ 122 /* run the real fprintf */
121 if (toto_debug) { 123 if (toto_debug) {
122 FILE *my_ssl_packet = fopen(file, "w+"); 124 FILE *my_ssl_packet = fopen(file, "w+");
123 fwrite(data, 1, length, my_ssl_packet); 125 fwrite(data, 1, length, my_ssl_packet);
124 fflush(my_ssl_packet); 126 fflush(my_ssl_packet);
125 fprintf(stderr, "Wrote SSL packet to drive, too.\n"); 127 fprintf(stderr, "%s: Wrote SSL packet to drive, too.\n", __func__);
126 fclose(my_ssl_packet); 128 fclose(my_ssl_packet);
127 } 129 }
128#endif 130#endif