Changeset 57 for trunk/classes/c


Ignore:
Timestamp:
May 11, 2023, 10:44:53 PM (2 years ago)
Author:
gyoung
Message:

Fix errors reported by CPPCheck

Location:
trunk/classes/c
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/classes/c/c_audio/cwastream.c

    r3 r57  
    7575     
    7676      if(!fgets(chrBuf, ulBufSize, fStream)) {
    77         fclose(fStream);
     77        // Fixme double deallocation is this missing a break;
     78        //fclose(fStream);
    7879        sprintf(chrBuf, DEFAULT_AUDIOSTREAM_SERVER);
    7980      }
  • trunk/classes/c/c_common/helper.c

    r49 r57  
    6262  HAPP         happ;
    6363  HWND hwndAppTerminateHandler;
    64   char startupDir[CCHMAXPATH];
     64  char startupDir[CCHMAXPATH] = {0};
    6565  char *chrPtr;
    6666
     
    7373  pDetails.pszParameters   = parameters;
    7474  /* Set the startup directory to the location of the executable */
    75   strncpy(startupDir, wrapperExe, sizeof(startupDir));
     75  strncpy(startupDir, wrapperExe, sizeof(startupDir) - 1);
    7676  //  SysWriteToTrapLog("1: %s %s\n", startupDir, wrapperExe);
    7777  if((chrPtr=strrchr(startupDir,'\\'))!=NULLHANDLE) {
  • trunk/classes/c/c_image/cwbmp.c

    r2 r57  
    706706    if(ppDetailsData)
    707707      {
    708         ULONG ulWidth, ulHeight, ulDepth;
     708        ULONG ulWidth = 0, ulHeight = 0, ulDepth = 0;
    709709        PBITMAPINFOHEADER2 pBmpInfoHeader2;       
    710710       
     
    725725        }
    726726       
    727         /* Fill the structure with the info to be displayed */     
     727        /* Fill the structure with the info to be displayed */
     728        // Fixme ulWidth and freinds are potentally uninitulized is the } above in the wrong place
    728729        pImageDetails=(PIMAGEDETAILS)*ppDetailsData; 
    729730        pImageDetails->ulWidth=ulWidth;
  • trunk/classes/c/c_mm/cwmmdisk.c

    r2 r57  
    9797                if((hObject=WinQueryObject(chrPlayerID))!=NULLHANDLE) {
    9898                  WPObject *wpObject;
    99                   HWND hwnd;
     99                  HWND hwnd = 0;
    100100                  wpObject=_wpclsQueryObject( _CWMMDisk , hObject);
    101101                  if(somIsObj(wpObject)) {
  • trunk/classes/c/c_mm/mmfolder.c

    r2 r57  
    358358              if((somIsObj(cwImageClass)||somIsObj(cwBitmapClass)) && !(_wpQueryStyle(wpObject) & OBJSTYLE_TEMPLATE)) {
    359359                HBITMAP hbm=NULLHANDLE;
    360                 PBITMAPINFOHEADER2 pBmpInfoHeader2;
     360                PBITMAPINFOHEADER2 pBmpInfoHeader2=NULLHANDLE;
    361361#ifdef DEBUG
    362362                SysWriteToTrapLog("Object is an image. (%s line: %d)\n", __FUNCTION__, __LINE__);
Note: See TracChangeset for help on using the changeset viewer.