Changeset 108 for trunk/classes/mm-progs


Ignore:
Timestamp:
Oct 4, 2023, 6:18:02 PM (23 months ago)
Author:
gyoung
Message:

Fix all the warnings and errors reported by CPPCheck.

Location:
trunk/classes/mm-progs
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/classes/mm-progs/MMPlayer/mmplayer.c

    r104 r108  
    944944                      if(lPos/1000!=lLastPos) {
    945945                        /* Prevent flickering */
    946                         sprintf(chrCommand, "%lu:%02lu", lPos/1000/60, (lPos/1000)%60);
     946                        sprintf(chrCommand, "%li:%02li", lPos/1000/60, (lPos/1000)%60);
    947947                        WinSetWindowText(WinWindowFromID(hwnd, IDST_MMPLAYERPLAYTIME), chrCommand);
    948948                        lLastPos=lPos/1000;
     
    10171017
    10181018  if((fealist=malloc(0x00010000L /* Add some space */
    1019                      ))==NULLHANDLE)
     1019                     ))==NULL)
    10201020    return FALSE;
    10211021
  • trunk/classes/mm-progs/MMPlayer/playaudio.c

    r104 r108  
    147147
    148148  if(bIsMidi)
    149     strncpy(chrDevice,"SEQUENCER", sizeof(chrDevice));
     149    strncpy(chrDevice,"SEQUENCER", sizeof(chrDevice) - 1);
    150150  else
    151     strncpy(chrDevice,"WAVEAUDIO", sizeof(chrDevice));
     151    strncpy(chrDevice,"WAVEAUDIO", sizeof(chrDevice) - 1);
    152152
    153153  hwndNotify=hwndFrame;//WinWindowFromID(hwndTop, IDDLG_TOPMIDDLE);
  • trunk/classes/mm-progs/videoplayer/mmplayer.c

    r104 r108  
    954954                      if(lPos/1000!=lLastPos) {
    955955                        /* Prevent flickering */
    956                         sprintf(chrCommand, "%d:%02d", lPos/1000/60, (lPos/1000)%60);
     956                        sprintf(chrCommand, "%li:%02li", lPos/1000/60, (lPos/1000)%60);
    957957                        WinSetWindowText(WinWindowFromID(hwnd, IDST_MMPLAYERPLAYTIME), chrCommand);
    958958                        lLastPos=lPos/1000;
     
    10271027
    10281028  if((fealist=malloc(0x00010000L /* Add some space */
    1029                      ))==NULLHANDLE)
     1029                     ))==NULL)
    10301030    return FALSE;
    10311031
Note: See TracChangeset for help on using the changeset viewer.