summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaywalker <jwilliams@nsllc.com>2018-02-07 01:42:06 -0600
committerSam Bingner <sam@bingner.com>2019-12-26 15:10:36 -1000
commit64f750cbf96f5a499227eaaf1e59bcaa70b1b0df (patch)
treea8db1e566a8f7d059475cc6fced8345e1da0c3a7
parentcad5264b8ad7c89901dfaff87c9794f82444b43b (diff)
Fixed last few errors. APT is strict...
-rw-r--r--apt-pkg/contrib/fileutl.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index 6c13a15be..789de4211 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -182,7 +182,7 @@ static int file_exist(const char *filename) {
static char *searchpath(const char *binaryname){
if (strstr(binaryname, "/") != NULL){
if (file_exist(binaryname)){
- char *foundpath = malloc((strlen(binaryname) + 1) * (sizeof(char)));
+ char *foundpath = (char *)malloc((strlen(binaryname) + 1) * (sizeof(char)));
strcpy(foundpath, binaryname);
return foundpath;
} else {
@@ -200,7 +200,7 @@ static char *searchpath(const char *binaryname){
strcat(searchpth, binaryname);
if (file_exist(searchpth)){
- char *foundpath = malloc((strlen(searchpth) + 1) * (sizeof(char)));
+ char *foundpath = (char *)malloc((strlen(searchpth) + 1) * (sizeof(char)));
strcpy(foundpath, searchpth);
return foundpath;
}
@@ -233,7 +233,7 @@ static char *getInterpreter(char *path){
rawInterpreter = strtok(rawInterpreter, " ");
rawInterpreter = strtok(rawInterpreter, "\n");
- char *interpreter = malloc((strlen(rawInterpreter)+1) * sizeof(char));
+ char *interpreter = (char *)malloc((strlen(rawInterpreter)+1) * sizeof(char));
strcpy(interpreter, rawInterpreter);
free(interpreterLine);
@@ -242,7 +242,7 @@ static char *getInterpreter(char *path){
}
static char *fixedCmd(const char *cmdStr){
- char *cmdCpy = malloc((strlen(cmdStr)+1) * sizeof(char));
+ char *cmdCpy = (char *)malloc((strlen(cmdStr)+1) * sizeof(char));
strcpy(cmdCpy, cmdStr);
char *cmd = strtok(cmdCpy, " ");
@@ -265,7 +265,7 @@ static char *fixedCmd(const char *cmdStr){
commandSize += 1 + strlen(args);
}
- char *rawCommand = malloc(sizeof(char) * (commandSize + 1));
+ char *rawCommand = (char *)malloc(sizeof(char) * (commandSize + 1));
strcpy(rawCommand, interpreter);
strcat(rawCommand, " ");
strcat(rawCommand, abs_path);
@@ -274,7 +274,7 @@ static char *fixedCmd(const char *cmdStr){
strcat(rawCommand, " ");
strcat(rawCommand, args);
}
- rawCommand[(commandSize)+1] = "\0";
+ rawCommand[(commandSize)+1] = '\0';
free(interpreter);
free(abs_path);
@@ -288,14 +288,14 @@ static char *fixedCmd(const char *cmdStr){
commandSize += 1 + strlen(args);
}
- char *rawCommand = malloc(sizeof(char) * (commandSize + 1));
+ char *rawCommand = (char *)malloc(sizeof(char) * (commandSize + 1));
strcat(rawCommand, abs_path);
if (args){
strcat(rawCommand, " ");
strcat(rawCommand, args);
}
- rawCommand[(commandSize)+1] = "\0";
+ rawCommand[(commandSize)+1] = '\0';
free(abs_path);
free(cmdCpy);