[PR #1910] Fix buffer truncation warnings in EPG time strings #2699

Open
opened 2026-01-29 17:23:29 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/CCExtractor/ccextractor/pull/1910
Author: @Harshdhall01
Created: 12/26/2025
Status: 🔄 Open

Base: masterHead: fix-epg-buffer-truncation


📝 Commits (3)

  • 532f443 Fix buffer truncation warnings in EPG time strings
  • 03d1810 Increase buffer size to 80 bytes to fully eliminate warnings
  • 9270313 Add size parameter to EPG_ATSC_calc_time to eliminate hardcoded buffer size

📊 Changes

2 files changed (+6 additions, -6 deletions)

View changed files

📝 src/lib_ccx/ts_functions.h (+2 -2)
📝 src/lib_ccx/ts_tables_epg.c (+4 -4)

📄 Description

Summary

Fixed buffer size for EPG time string buffers to prevent truncation warnings.

Changes

  • Increased start_time_string and end_time_string buffer size from 21 to 32 bytes in ts_functions.h

Rationale

The compiler warned that snprintf formatting in ts_tables_epg.c could truncate with large year values (e.g., 5+ digit years). While unlikely in practice, this fix ensures safety and eliminates three compiler warnings at lines 130, 150, and 181.

Testing

  • Compiled successfully with no truncation warnings in ts_tables_epg.c

Warnings Fixed

../src/lib_ccx/ts_tables_epg.c:130:35: warning: '%02d' directive output may be truncated
../src/lib_ccx/ts_tables_epg.c:150:92: warning: '%02ld' directive output may be truncated
../src/lib_ccx/ts_tables_epg.c:181:87: warning: '%02d' directive output may be truncated

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/CCExtractor/ccextractor/pull/1910 **Author:** [@Harshdhall01](https://github.com/Harshdhall01) **Created:** 12/26/2025 **Status:** 🔄 Open **Base:** `master` ← **Head:** `fix-epg-buffer-truncation` --- ### 📝 Commits (3) - [`532f443`](https://github.com/CCExtractor/ccextractor/commit/532f443e5ca0f92169174d498e84ba791415de20) Fix buffer truncation warnings in EPG time strings - [`03d1810`](https://github.com/CCExtractor/ccextractor/commit/03d181056869b8da9b3f63bc8cb5d89680316ad3) Increase buffer size to 80 bytes to fully eliminate warnings - [`9270313`](https://github.com/CCExtractor/ccextractor/commit/9270313d16106623508dba5badb0b32d7dc68ca7) Add size parameter to EPG_ATSC_calc_time to eliminate hardcoded buffer size ### 📊 Changes **2 files changed** (+6 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `src/lib_ccx/ts_functions.h` (+2 -2) 📝 `src/lib_ccx/ts_tables_epg.c` (+4 -4) </details> ### 📄 Description ## Summary Fixed buffer size for EPG time string buffers to prevent truncation warnings. ## Changes - Increased `start_time_string` and `end_time_string` buffer size from 21 to 32 bytes in `ts_functions.h` ## Rationale The compiler warned that `snprintf` formatting in `ts_tables_epg.c` could truncate with large year values (e.g., 5+ digit years). While unlikely in practice, this fix ensures safety and eliminates three compiler warnings at lines 130, 150, and 181. ## Testing - Compiled successfully with no truncation warnings in `ts_tables_epg.c` ## Warnings Fixed ``` ../src/lib_ccx/ts_tables_epg.c:130:35: warning: '%02d' directive output may be truncated ../src/lib_ccx/ts_tables_epg.c:150:92: warning: '%02ld' directive output may be truncated ../src/lib_ccx/ts_tables_epg.c:181:87: warning: '%02d' directive output may be truncated ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 17:23:29 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2699