Flawfinder version 2.0.10, (C) 2001-2019 David A. Wheeler.
Number of rules (primarily dangerous function names) in C/C++ ruleset: 223
Examining data/sdl-ball-1.02/declerations.h
Examining data/sdl-ball-1.02/highscores.cpp
Examining data/sdl-ball-1.02/effects.cpp
Examining data/sdl-ball-1.02/loadlevel.cpp
Examining data/sdl-ball-1.02/leveleditor/gimp-leveleditor/gimp-sdlball.c
Examining data/sdl-ball-1.02/text.cpp
Examining data/sdl-ball-1.02/background.cpp
Examining data/sdl-ball-1.02/menu.cpp
Examining data/sdl-ball-1.02/title.cpp
Examining data/sdl-ball-1.02/scoreboard.cpp
Examining data/sdl-ball-1.02/sound.cpp
Examining data/sdl-ball-1.02/input.cpp
Examining data/sdl-ball-1.02/main.cpp

FINAL RESULTS:

data/sdl-ball-1.02/main.cpp:3448:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
  strcpy(game.name, name.data() );
data/sdl-ball-1.02/main.cpp:3666:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(cName, "%s/sdl-ball_%i.tga",privFile.screenshotDir.data(),i);
data/sdl-ball-1.02/menu.cpp:207:11:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
          sprintf(highScores[t], "SDL-BALL v "VERSION );
data/sdl-ball-1.02/menu.cpp:240:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
        sprintf(highScores[t], "%s%i - %s", final[t].level.data(), final[t].score, final[t].name.data());
data/sdl-ball-1.02/main.cpp:3769:6:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  if(getenv("XDG_CONFIG_HOME") != NULL)
data/sdl-ball-1.02/main.cpp:3771:28:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    privFile.programRoot = getenv("XDG_CONFIG_HOME");
data/sdl-ball-1.02/main.cpp:3772:13:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  } else if(getenv("HOME") != NULL) { 
data/sdl-ball-1.02/main.cpp:3773:28:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    privFile.programRoot = getenv("HOME");
data/sdl-ball-1.02/main.cpp:3812:3:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  srand((unsigned)time(0));
data/sdl-ball-1.02/highscores.cpp:81:18:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
          hsList.open(privFile.highScoreFile.data(), ios::out | ios::app);
data/sdl-ball-1.02/leveleditor/gimp-leveleditor/gimp-sdlball.c:210:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char level[23][26];
data/sdl-ball-1.02/leveleditor/gimp-leveleditor/gimp-sdlball.c:212:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char brickColor[23][26][7];
data/sdl-ball-1.02/leveleditor/gimp-leveleditor/gimp-sdlball.c:214:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char powerups[23][26];
data/sdl-ball-1.02/leveleditor/gimp-leveleditor/gimp-sdlball.c:267:13:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
            sprintf(brickColor[row][bri], "%02X%02X%02X",pix[0],pix[1],pix[2]);
data/sdl-ball-1.02/loadlevel.cpp:178:42:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
              var.scrollInfo.dropspeed = atol( line.substr(7,line.length()).data() );
data/sdl-ball-1.02/loadlevel.cpp:189:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                char rgb[3][5];
data/sdl-ball-1.02/loadlevel.cpp:191:17:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
                sprintf(rgb[0], "0x%c%c", line[ch+2], line[ch+3]);
data/sdl-ball-1.02/loadlevel.cpp:192:17:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
                sprintf(rgb[1], "0x%c%c", line[ch+4], line[ch+5]);
data/sdl-ball-1.02/loadlevel.cpp:193:17:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
                sprintf(rgb[2], "0x%c%c", line[ch+6], line[ch+7]);
data/sdl-ball-1.02/loadlevel.cpp:351:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(bricks[i].tex.prop.glTexColorInfo,tempCol, sizeof(tempCol));
data/sdl-ball-1.02/loadlevel.cpp:352:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(bricks[i].tex.prop.glParColorInfo,tempParCol,sizeof(tempParCol));
data/sdl-ball-1.02/main.cpp:602:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char rgba[4][5];
data/sdl-ball-1.02/main.cpp:605:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    f.open( fileName.data() );
data/sdl-ball-1.02/main.cpp:624:27:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
            tex.prop.cols=atoi(val.data());
data/sdl-ball-1.02/main.cpp:627:27:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
            tex.prop.rows=atoi(val.data());
data/sdl-ball-1.02/main.cpp:630:28:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
            tex.prop.ticks=atoi(val.data());
data/sdl-ball-1.02/main.cpp:633:29:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
            tex.prop.frames=atoi(val.data());
data/sdl-ball-1.02/main.cpp:636:28:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
            tex.prop.bidir=atoi(val.data());
data/sdl-ball-1.02/main.cpp:639:30:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
            tex.prop.playing=atoi(val.data());
data/sdl-ball-1.02/main.cpp:642:30:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
            tex.prop.padding=atoi(val.data());
data/sdl-ball-1.02/main.cpp:647:11:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
          sprintf(rgba[0], "0x%c%c", val[0], val[1]);
data/sdl-ball-1.02/main.cpp:648:11:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
          sprintf(rgba[1], "0x%c%c", val[2], val[3]);
data/sdl-ball-1.02/main.cpp:649:11:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
          sprintf(rgba[2], "0x%c%c", val[4], val[5]);
data/sdl-ball-1.02/main.cpp:650:11:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
          sprintf(rgba[3], "0x%c%c", val[6], val[7]);
data/sdl-ball-1.02/main.cpp:659:11:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
          sprintf(rgba[0], "0x%c%c", val[0], val[1]);
data/sdl-ball-1.02/main.cpp:660:11:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
          sprintf(rgba[1], "0x%c%c", val[2], val[3]);
data/sdl-ball-1.02/main.cpp:661:11:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
          sprintf(rgba[2], "0x%c%c", val[4], val[5]);
data/sdl-ball-1.02/main.cpp:3191:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char clockString[13]; //Clock: 00:00\0
data/sdl-ball-1.02/main.cpp:3266:9:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
        sprintf(clockString, "Clock: %02i:%02i", timeStruct.tm_hour, timeStruct.tm_min); //Array is exactly 13 chars wide
data/sdl-ball-1.02/main.cpp:3374:8:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  conf.open(privFile.settingsFile.data(),ios::out | ios::trunc); //homeDirFiles.settingsFile.data()
data/sdl-ball-1.02/main.cpp:3440:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char name[32];
data/sdl-ball-1.02/main.cpp:3450:8:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  file.open(privFile.saveGameFile.data(), ios::out | ios::in | ios::binary);
data/sdl-ball-1.02/main.cpp:3466:8:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  file.open(privFile.saveGameFile.data(), ios::out | ios::in | ios::binary);
data/sdl-ball-1.02/main.cpp:3489:8:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  file.open(privFile.saveGameFile.data(), ios::in | ios::binary);
data/sdl-ball-1.02/main.cpp:3513:8:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  file.open(privFile.saveGameFile.data() , ios::in | ios::binary);
data/sdl-ball-1.02/main.cpp:3517:10:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    file.open(privFile.saveGameFile.data(), ios::out | ios::binary);
data/sdl-ball-1.02/main.cpp:3526:10:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    file.open(privFile.saveGameFile.data() , ios::in | ios::binary);
data/sdl-ball-1.02/main.cpp:3545:10:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    file.open(privFile.saveGameFile.data() , ios::in | ios::binary);
data/sdl-ball-1.02/main.cpp:3661:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char cName[256];
data/sdl-ball-1.02/main.cpp:3667:15:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    fscreen = fopen(cName,"rb");
data/sdl-ball-1.02/main.cpp:3681:13:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  fscreen = fopen(cName,"wb");
data/sdl-ball-1.02/main.cpp:3686:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char TGAheader[12]={0,0,2,0,0,0,0,0,0,0,0,0};
data/sdl-ball-1.02/main.cpp:3687:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char header[6] = { (unsigned char)(setting.resx%256), (unsigned char)(setting.resx/256),(unsigned char)(setting.resy%256),(unsigned char)(setting.resy/256),24,0};
data/sdl-ball-1.02/main.cpp:3817:8:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  conf.open( privFile.settingsFile.data() );
data/sdl-ball-1.02/main.cpp:3830:28:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          setting.eyeCandy=atoi(val.data());
data/sdl-ball-1.02/main.cpp:3834:24:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          setting.resx=atoi(val.data());
data/sdl-ball-1.02/main.cpp:3838:24:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          setting.resy=atoi(val.data());
data/sdl-ball-1.02/main.cpp:3841:26:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          setting.showBg=atoi(val.data());
data/sdl-ball-1.02/main.cpp:3844:30:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          setting.fullscreen=atoi(val.data());
data/sdl-ball-1.02/main.cpp:3847:35:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          setting.particleCollide=atoi(val.data());
data/sdl-ball-1.02/main.cpp:3850:25:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          setting.sound=atoi(val.data());
data/sdl-ball-1.02/main.cpp:3853:26:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          setting.stereo=atoi(val.data());
data/sdl-ball-1.02/main.cpp:3865:38:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          setting.keyRight = (SDLKey)atoi(val.data());
data/sdl-ball-1.02/main.cpp:3868:37:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          setting.keyLeft = (SDLKey)atoi(val.data());
data/sdl-ball-1.02/main.cpp:3871:38:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          setting.keyShoot = (SDLKey)atoi(val.data());
data/sdl-ball-1.02/main.cpp:3874:39:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          setting.keyNextPo = (SDLKey)atoi(val.data());
data/sdl-ball-1.02/main.cpp:3877:38:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          setting.keyBuyPo = (SDLKey)atoi(val.data());
data/sdl-ball-1.02/main.cpp:3880:39:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          setting.keyPrevPo = (SDLKey)atoi(val.data());
data/sdl-ball-1.02/main.cpp:3883:32:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          setting.joyEnabled = atoi(val.data());
data/sdl-ball-1.02/main.cpp:3886:34:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          setting.joyIsDigital = atoi(val.data());
data/sdl-ball-1.02/main.cpp:3889:38:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          setting.JoyCalHighJitter = atoi(val.data());
data/sdl-ball-1.02/main.cpp:3892:37:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          setting.JoyCalLowJitter = atoi(val.data());
data/sdl-ball-1.02/main.cpp:3895:31:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          setting.JoyCalMax = atoi(val.data());
data/sdl-ball-1.02/main.cpp:3898:31:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          setting.JoyCalMin = atoi(val.data());
data/sdl-ball-1.02/main.cpp:3910:29:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          player.difficulty=atoi(val.data());
data/sdl-ball-1.02/main.cpp:3913:29:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          setting.showClock=atoi(val.data());
data/sdl-ball-1.02/main.cpp:3916:23:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          setting.fps=atoi(val.data());
data/sdl-ball-1.02/main.cpp:4100:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char txt[256];
data/sdl-ball-1.02/main.cpp:4212:13:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
            sprintf(txt, "Bonus: %i", bMan.activeBalls*150);
data/sdl-ball-1.02/main.cpp:4245:15:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
              sprintf(txt, "Level %i",player.level+1); //+1 fordi levels starter fra 0
data/sdl-ball-1.02/main.cpp:4338:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(nbrick, updated_nbrick, sizeof(updated_nbrick));
data/sdl-ball-1.02/menu.cpp:35:10:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  hsList.open(privFile.highScoreFile.data());
data/sdl-ball-1.02/menu.cpp:52:28:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          final[i].score = atoi(line.substr(delim[0]+1, delim[1]).data());
data/sdl-ball-1.02/menu.cpp:56:28:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          final[i].score = atoi(line.substr(0, line.find('|')).data());
data/sdl-ball-1.02/menu.cpp:129:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char highScores[20][255];
data/sdl-ball-1.02/menu.cpp:210:11:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
          sprintf(highScores[t], "-----------------------");
data/sdl-ball-1.02/menu.cpp:213:11:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
          sprintf(highScores[t], "Copyleft GPLv3 2008-2014 Jimmy Christensen");
data/sdl-ball-1.02/menu.cpp:216:11:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
          sprintf(highScores[t], "Based on Dx-Ball by Michael P. Welch");
data/sdl-ball-1.02/menu.cpp:219:11:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
          sprintf(highScores[t], "Based on Megaball by Ed and Al Mackey");
data/sdl-ball-1.02/menu.cpp:222:11:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
          sprintf(highScores[t], "-----------------------");
data/sdl-ball-1.02/menu.cpp:225:11:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
          sprintf(highScores[t], "Thanks to players, packagers and patchers!");
data/sdl-ball-1.02/menu.cpp:228:11:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
          sprintf(highScores[t], "Greetings to everyone!");
data/sdl-ball-1.02/menu.cpp:231:11:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
          sprintf(highScores[t], "SDL-Ball - %i", (t*-1)+20 );
data/sdl-ball-1.02/scoreboard.cpp:27:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char tempText[255];
data/sdl-ball-1.02/scoreboard.cpp:61:9:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
        sprintf(tempText, "%i", tempScore);
data/sdl-ball-1.02/text.cpp:62:5:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  f.open( useTheme("/font/fonts.txt",setting.gfxTheme).data() );
data/sdl-ball-1.02/text.cpp:77:32:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          genFontTex(tempName, atoi(val.data()), FONT_MENU);
data/sdl-ball-1.02/text.cpp:83:32:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          genFontTex(tempName, atoi(val.data()), FONT_ANNOUNCE_GOOD);
data/sdl-ball-1.02/text.cpp:90:32:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          genFontTex(tempName, atoi(val.data()), FONT_ANNOUNCE_BAD);
data/sdl-ball-1.02/text.cpp:96:32:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          genFontTex(tempName, atoi(val.data()), FONT_HIGHSCORE);
data/sdl-ball-1.02/text.cpp:102:32:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          genFontTex(tempName, atoi(val.data()), FONT_MENUHIGHSCORE);
data/sdl-ball-1.02/text.cpp:108:32:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          genFontTex(tempName, atoi(val.data()), FONT_INTROHIGHSCORE);
data/sdl-ball-1.02/text.cpp:114:32:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          genFontTex(tempName, atoi(val.data()), FONT_INTRODESCRIPTION);
data/sdl-ball-1.02/text.cpp:130:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char tempChar[2] = { 0,0 };
data/sdl-ball-1.02/title.cpp:300:5:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  f.open( useTheme("/powerupdescriptions.txt", setting.gfxTheme).data() );
data/sdl-ball-1.02/input.cpp:363:11:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
          usleep(500000);
data/sdl-ball-1.02/main.cpp:3495:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  file.read((char *)(&game), sizeof(savedGame));
data/sdl-ball-1.02/main.cpp:3537:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  file.read((char *)(&sgHead), sizeof(int));
data/sdl-ball-1.02/main.cpp:3556:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    file.read((char *)(&slot[i]), sizeof(savedGame));
data/sdl-ball-1.02/main.cpp:4668:5:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
    usleep( 1000 );

ANALYSIS SUMMARY:

Hits = 110
Lines analyzed = 8903 in approximately 0.24 seconds (36514 lines/second)
Physical Source Lines of Code (SLOC) = 7141
Hits@level = [0]   9 [1]   5 [2]  96 [3]   5 [4]   4 [5]   0
Hits@level+ = [0+] 119 [1+] 110 [2+] 105 [3+]   9 [4+]   4 [5+]   0
Hits/KSLOC@level+ = [0+] 16.6643 [1+] 15.404 [2+] 14.7038 [3+] 1.26033 [4+] 0.560146 [5+]   0
Dot directories skipped = 1 (--followdotdir overrides)
Minimum risk level = 1
Not every hit is necessarily a security vulnerability.
There may be other security vulnerabilities; review your code!
See 'Secure Programming HOWTO'
(https://dwheeler.com/secure-programs) for more information.