replaced malloc with strcpy with strdup
heh
This commit is contained in:
parent
4ec8edafcb
commit
bf96f9e55e
@ -63,16 +63,10 @@ outputFlags decryptText(char *text, char *keyNew)
|
||||
char *textBuffer = malloc(1);
|
||||
int textKeyChainLength;
|
||||
int *textKeyChain;
|
||||
char *key = malloc(strlen(keyNew) + 1);
|
||||
char *key = strdup(keyNew); //COPY keyNew TO key
|
||||
int *encryptedTextKeyChain;
|
||||
char *usedText = malloc(strlen(text) + 1);
|
||||
char *usedTextCopy = usedText;
|
||||
|
||||
//COPY keyNew TO key
|
||||
strcpy(key, keyNew);
|
||||
|
||||
//COPY text TO usedText
|
||||
strcpy(usedText, text);
|
||||
char *usedText = strdup(text); //COPY text TO usedText
|
||||
char *usedTextCopy = usedText; //TODO: wtf
|
||||
|
||||
//GET LENGTH OF returningText AND textKeyChain
|
||||
for (int i = 0; i < (int) strlen(usedText); i++)
|
||||
|
@ -79,8 +79,7 @@ logFile initLogger(char *directoryPath)
|
||||
//CREATE SYMLINK
|
||||
sprintf(latestBuffer, LOG_LATEST_FORMATTING, WRITE_DIR, LOG_LATEST); //GENERATE LATEST.log PATH
|
||||
|
||||
latestFilePath = malloc(strlen(filePath) + 1);
|
||||
strcpy(latestFilePath, filePath);
|
||||
latestFilePath = strdup(filePath);
|
||||
|
||||
if (access(latestBuffer, R_OK) == 0) { unlink(latestBuffer); } //REMOVE SYMLINK IF IT ALREADY EXISTS
|
||||
(void) (symlink(latestFilePath + (strlen(WRITE_DIR) + 1), latestBuffer) + 1); //TODO: Try to create some function for processing exit value //CREATE
|
||||
|
Loading…
x
Reference in New Issue
Block a user