From 0fa22d45704d7946a80911b650c2f9465f9647c0 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 12 Jul 2010 13:26:38 +0000 Subject: [PATCH] use snprintf git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@656 e54a6e83-5905-42d5-8d5c-058d10e6a962 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a82a2410b9d19bb97a28e42643cbe6a81a1d9b76 Author: Jacek Jendrzej Date: 2010-07-12 (Mon, 12 Jul 2010) Origin message was: ------------------ -use snprintf git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@656 e54a6e83-5905-42d5-8d5c-058d10e6a962 ------------------ This commit was generated by Migit --- src/gui/audio_select.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui/audio_select.cpp b/src/gui/audio_select.cpp index dc1dcfc99..30d07c8e4 100644 --- a/src/gui/audio_select.cpp +++ b/src/gui/audio_select.cpp @@ -90,7 +90,7 @@ int CAudioSelectMenuHandler::doMenu () for(count=0; count < g_RemoteControl->current_PIDs.APIDs.size(); count++ ) { char apid[5]; - sprintf(apid, "%d", count); + snprintf(apid,sizeof(apid), "%d", count); AudioSelector.addItem(new CMenuForwarderNonLocalized( g_RemoteControl->current_PIDs.APIDs[count].desc, true, NULL, APIDChanger, apid, CRCInput::convertDigitToKey(count + 1)), @@ -129,9 +129,9 @@ int CAudioSelectMenuHandler::doMenu () AudioSelector.addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_SUBTITLES_HEAD)); } char spid[10]; - sprintf(spid, "DVB:%d", sd->pId); + snprintf(spid,sizeof(spid), "DVB:%d", sd->pId); char item[64]; - sprintf(item, "DVB: %s (pid %x)", sd->ISO639_language_code.c_str(), sd->pId); + snprintf(item,sizeof(item), "DVB: %s (pid %x)", sd->ISO639_language_code.c_str(), sd->pId); AudioSelector.addItem(new CMenuForwarderNonLocalized(item /*sd->ISO639_language_code.c_str()*/, sd->pId != dvbsub_getpid(), NULL, &SubtitleChanger, spid, CRCInput::convertDigitToKey(++count))); } @@ -145,9 +145,9 @@ int CAudioSelectMenuHandler::doMenu () char spid[64]; int page = ((sd->teletext_magazine_number & 0xFF) << 8) | sd->teletext_page_number; int pid = sd->pId; - sprintf(spid, "TTX:%d:%03X:%s", sd->pId, page, sd->ISO639_language_code.c_str()); + snprintf(spid,sizeof(spid), "TTX:%d:%03X:%s", sd->pId, page, sd->ISO639_language_code.c_str()); char item[64]; - sprintf(item, "TTX: %s (pid %x page %03X)", sd->ISO639_language_code.c_str(), sd->pId, page); + snprintf(item,sizeof(item), "TTX: %s (pid %x page %03X)", sd->ISO639_language_code.c_str(), sd->pId, page); AudioSelector.addItem(new CMenuForwarderNonLocalized(item /*sd->ISO639_language_code.c_str()*/, !tuxtx_subtitle_running(&pid, &page, NULL), NULL, &SubtitleChanger, spid, CRCInput::convertDigitToKey(++count))); }