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

Fix errors reported by CPPCheck

Location:
trunk/mediafolder/c/helper
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/mediafolder/c/helper/cddbhelper.cpp

    r2 r57  
    4040void extern printError(char* errorString)
    4141{
    42   char buffer[CCHMAXPATH];
     42    char buffer[CCHMAXPATH] = {0};
    4343  char *ptr;
    4444
     
    4747  writeLog(errorString);
    4848  if(hwndError) {
    49     strncpy(buffer, errorString, sizeof(buffer));
     49    strncpy(buffer, errorString, sizeof(buffer) - 1);
    5050    ptr=strchr(buffer,'\n');
    5151    if(ptr) {
  • trunk/mediafolder/c/helper/launchpad.cpp

    r2 r57  
    557557        static HWND hwndBubbleClient;
    558558        ULONG style=FCF_BORDER|FCF_NOBYTEALIGN;
    559         char winText[255];
     559        char winText[255] = {0};
    560560       
    561561        /* Get window text for size calculating */
     
    10281028    if(somIsObj(folderClass))
    10291029      wpFolder=(WPFolder*)((M_WPFolder*)folderClass)->wpclsQueryFolder(chrConfigID, FALSE);
    1030   }
    1031 
     1030    if(!somIsObj(wpFolder))
     1031      return FALSE;
     1032  }
     1033  else
     1034    return FALSE;
     1035
     1036  // Fixme see line 1106
    10321037  ulBufferSize=sizeof(chrPath);
    10331038  wpFolder->wpQueryRealName(chrPath, &ulBufferSize, TRUE);
     
    11011106      return FALSE;
    11021107  }
    1103  
     1108  else
     1109    return FALSE;
     1110  // Fixme wpFolder can be uninittailized if(somIsObj(wpParentFolder)) is false sould we return FALSE
    11041111  /* Build ini name */
    11051112  ulBufferSize=sizeof(chrPath);
Note: See TracChangeset for help on using the changeset viewer.