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

Fix errors reported by CPPCheck

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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) {
Note: See TracChangeset for help on using the changeset viewer.