Skip to content

Commit

Permalink
Merge pull request #183 from 1000TurquoisePogs/bugfix/compile-warnings
Browse files Browse the repository at this point in the history
Small bugfix for compile warnings
  • Loading branch information
1000TurquoisePogs authored May 22, 2020
2 parents 3c980f3 + f19fa96 commit 36d89c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions c/envService.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "alloc.h"
#include "json.h"

extern char **environ;
Expand All @@ -37,7 +38,7 @@ static char* splitEnvKeyValue(char buf[], char* array[]) {
char *bufCpy;
if(buf != NULL){
int bufferLen = strlen(buf);
bufCpy = safeMalloc(bufferLen + 1, "buffer copy");
bufCpy = (char*) safeMalloc(bufferLen + 1, "buffer copy");
memcpy(bufCpy, buf, bufferLen);
array[0] = strtok (bufCpy, "=");
array[1] = strtok (NULL, "=");
Expand Down Expand Up @@ -194,4 +195,4 @@ JsonObject *readEnvSettings(const char *prefix) {
SPDX-License-Identifier: EPL-2.0
Copyright Contributors to the Zowe Project.
*/
*/
5 changes: 3 additions & 2 deletions c/zss.c
Original file line number Diff line number Diff line change
Expand Up @@ -977,8 +977,9 @@ int initializeJwtKeystoreIfConfigured(JsonObject *const serverConfig,
JsonObject *const jwtSettings = jsonObjectGetObject(agentSettings, "jwt");
char *envTokenName = jsonObjectGetString(envSettings, "ZWED_agent_jwt_token_name");
char *envTokenLabel = jsonObjectGetString(envSettings, "ZWED_agent_jwt_token_label");
int envFallback = (jsonObjectGetBoolean(envSettings, "ZWED_agent_jwt_fallback") != NULL) ?
jsonObjectGetBoolean(envSettings, "ZWED_agent_jwt_fallback") : TRUE;
Json *envFallbackJsonVal = jsonObjectGetPropertyValue(envSettings, "ZWED_agent_jwt_fallback");
int envFallback = (envFallbackJsonVal && jsonIsBoolean(envFallbackJsonVal)) ?
jsonAsBoolean(envFallbackJsonVal) : TRUE;
bool envIsSet = (envTokenName != NULL
&& envTokenLabel != NULL);

Expand Down

0 comments on commit 36d89c4

Please sign in to comment.