Skip to content

Commit

Permalink
Allow empty values.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinmera committed Jul 10, 2017
1 parent 47f4977 commit b5aa1a4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/portacle_credentials.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,10 @@ int credentials_read(FILE *stream, struct credentials *out, int decrypt){

char *key = strtok(line, "=");
char *val = strtok(0, "=");
if(!key || !val){
if(!key){
return 0;
}
if(!val) val = "";

/* */ if(streq(key, "protocol")){
strncpy(out->protocol, val, 64);
Expand Down

0 comments on commit b5aa1a4

Please sign in to comment.