summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaywalker <jwilliams@nsllc.com>2018-02-07 01:42:06 -0600
committerJaywalker <jwilliams@nsllc.com>2018-02-07 01:42:06 -0600
commit2363847d2685a6abe4a23620d2a09296a80c47b3 (patch)
tree74214b5bf15cd8a9ba6574f841d4bb86de16fd70
parenta227e74c6eeeca16ecb5dd6faa933e6d8c297841 (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 383a9b7aa..25deec083 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -176,7 +176,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 {
@@ -194,7 +194,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;
}
@@ -227,7 +227,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);
@@ -236,7 +236,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, " ");
@@ -259,7 +259,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);
@@ -268,7 +268,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);
@@ -282,14 +282,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);