Skip to content

Commit c1eb060

Browse files
committed
fix: correct format specifiers and remove duplicate CMake option
- Fix %u -> %zu for size_t in Sending header and Sending EPG debug logs - Fix %u -> %d for int in Sending bytes debug log - Remove duplicate option(NETWORKING_DEBUG) and if(NETWORKING_DEBUG) blocks in CMakeLists.txt Addresses Copilot review comments on #2175.
1 parent aa23275 commit c1eb060

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ option (WITH_FFMPEG "Build using FFmpeg demuxer and decoder" OFF)
77
option (WITH_OCR "Build with OCR (Optical Character Recognition) feature" OFF)
88
option (WITH_HARDSUBX "Build with support for burned-in subtitles" OFF)
99
option (NETWORKING_DEBUG "Enable networking debug output" OFF)
10-
option (NETWORKING_DEBUG "Enable networking debug output" OFF)
1110

1211
# Version number
1312
set (CCEXTRACTOR_VERSION_MAJOR 0)
@@ -151,10 +150,6 @@ if (NETWORKING_DEBUG)
151150
add_definitions(-DNETWORKING_DEBUG)
152151
message(STATUS "Networking debug output enabled")
153152
endif (NETWORKING_DEBUG)
154-
if (NETWORKING_DEBUG)
155-
add_definitions(-DNETWORKING_DEBUG)
156-
message(STATUS "Networking debug output enabled")
157-
endif (NETWORKING_DEBUG)
158153
add_subdirectory (lib_ccx)
159154

160155
aux_source_directory(${PROJECT_SOURCE_DIR} SOURCEFILE)

src/lib_ccx/networking.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ void net_send_header(const unsigned char *data, size_t len)
142142
assert(srv_sd > 0);
143143

144144
#ifdef NETWORKING_DEBUG
145-
fprintf(stderr, "Sending header (len = %u): \n", len);
145+
fprintf(stderr, "Sending header (len = %zu): \n", len);
146146
fprintf(stderr, "File created by %02X version %02X%02X\n", data[3], data[4], data[5]);
147147
fprintf(stderr, "File format revision: %02X%02X\n", data[6], data[7]);
148148
#endif
@@ -171,7 +171,7 @@ int net_send_cc(const unsigned char *data, int len, void *private_data, struct c
171171
assert(srv_sd > 0);
172172

173173
#ifdef NETWORKING_DEBUG
174-
fprintf(stderr, "[C] Sending %u bytes\n", len);
174+
fprintf(stderr, "[C] Sending %d bytes\n", len);
175175
#endif
176176

177177
if (write_block(srv_sd, BIN_DATA, data, len) <= 0)
@@ -323,7 +323,7 @@ void net_send_epg(
323323
end += c;
324324

325325
#ifdef NETWORKING_DEBUG
326-
fprintf(stderr, "[C] Sending EPG: %u bytes\n", len);
326+
fprintf(stderr, "[C] Sending EPG: %zu bytes\n", len);
327327
#endif
328328

329329
if (write_block(srv_sd, EPG_DATA, epg, len) <= 0)

0 commit comments

Comments
 (0)