initializing memory before copying to the buffer for getExeDir()

This commit is contained in:
Matt Hill
2015-07-29 00:04:53 -04:00
parent f3c91096e5
commit b579f931d8
2 changed files with 3 additions and 2 deletions

View File

@@ -30,8 +30,9 @@ namespace alpr
return directory;
#else
char buffer[2048];
memset(buffer, 0, sizeof(buffer));
readlink("/proc/self/exe", buffer, 2048);
readlink("/proc/self/exe", buffer, sizeof(buffer));
std::stringstream ss;
ss << buffer;

View File

@@ -1,7 +1,7 @@
#ifndef OPENALPR_PLATFORM_H
#define OPENALPR_PLATFORM_H
#include <string>
#include <string.h>
#include <sstream>
#ifdef WINDOWS