Changeset 142 for trunk/classes/mm-progs


Ignore:
Timestamp:
Jan 21, 2024, 10:17:50 PM (19 months ago)
Author:
gyoung
Message:

Fix warnings and error found by C++Check

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

Legend:

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

    r126 r142  
    315315
    316316  if(bIsMidi)
    317     strncpy(chrDevice,"SEQUENCER", sizeof(chrDevice));
     317    strncpy(chrDevice,"SEQUENCER", sizeof(chrDevice) - 1);
    318318  else
    319     strncpy(chrDevice,"WAVEAUDIO", sizeof(chrDevice));
     319    strncpy(chrDevice,"WAVEAUDIO", sizeof(chrDevice) - 1);
    320320
    321321  /* Start audio file */
  • trunk/classes/mm-progs/videoplayer/mmplayer.c

    r108 r142  
    159159
    160160/* Track to play. Full path */
    161 char chrSourceName[CCHMAXPATH]={0};
     161char chrSourceName[CCHMAXPATH + 1]={0};
    162162char * chrPtrName=NULLHANDLE; /* Pointer to filename */
    163163char chrClassName[100]= {0};
  • trunk/classes/mm-progs/videoplayer/playaudio.c

    r57 r142  
    158158    strncpy(chrDevice,"WAVEAUDIO", sizeof(chrDevice));
    159159#endif
    160   strncpy(chrDevice,"DIGITALVIDEO02", sizeof(chrDevice));
     160  strncpy(chrDevice,"DIGITALVIDEO02", sizeof(chrDevice) - 1);
    161161  //  strncpy(chrDevice,"xine", sizeof(chrDevice));
    162162  hwndNotify=hwndFrame;//WinWindowFromID(hwndTop, IDDLG_TOPMIDDLE);
  • trunk/classes/mm-progs/videoplayer/vioplayer.c

    r2 r142  
    231231  /* Save source name */
    232232  if(argc==2)
    233     strcpy(chrSourceName, argv[1]);
     233    strncpy(chrSourceName, argv[1], CCHMAXPATH);
    234234  printf("File: %s\n", chrSourceName);
    235235
Note: See TracChangeset for help on using the changeset viewer.