Fix string length type as size_t 47/307147/1
authorArtur Świgoń <a.swigon@samsung.com>
Tue, 5 Mar 2024 09:26:24 +0000 (10:26 +0100)
committerArtur Świgoń <a.swigon@samsung.com>
Tue, 5 Mar 2024 09:49:36 +0000 (09:49 +0000)
Change-Id: I77cc57d560ff8ac61a3a6bfa1e67efbed6850d09
(cherry picked from commit 0432aa335f44a271b053916e3840d28edc95fc1f)

src/screen_reader_tts.c

index 6c03b26aaf5059b41f825694d69a783619e1cc8a..e5a1f181f33e59aa2a81c442e02bd231ee450782 100644 (file)
@@ -69,9 +69,9 @@ static const char *sprintf_command(Read_Command *command)
        if (command) {
                const char *text = command->context.text;
                int slices = command->context.chunk_count;
-               int length = text ? strlen(text) : -1;
+               size_t length = text ? strlen(text) : 0;
 
-               g_snprintf(buffer, sizeof(buffer), "RCmd %p (id %d, %c%c%c len %d, slices %d, text %s)", command,
+               g_snprintf(buffer, sizeof(buffer), "RCmd %p (id %d, %c%c%c len %zu, slices %d, text %s)", command,
                                 command->context.last_id,
                                 command->discardable ? 'D' : '-', command->want_discard_previous_reading ? 'W' : '-',
                                 command->is_playing ? 'P' : '-',