Skip to content

Commit

Permalink
Moved the default filename to constant
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbasso committed Jun 28, 2012
1 parent 0fc916e commit 8680b89
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gistit.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
#include "jansson.h" #include "jansson.h"


#define VERSION "0.1" #define VERSION "0.1"

#define STDIN_BUFFER_SIZE 1024 #define STDIN_BUFFER_SIZE 1024
#define DEFAULT_STDIN_FILENAME "default.txt"

#define ENV_ACCESS_TOKEN_KEY "GISTIT_TOKEN" #define ENV_ACCESS_TOKEN_KEY "GISTIT_TOKEN"
#define GITHUB_GIST_URL "https://api.github.com/gists?access_token=%s" #define GITHUB_GIST_URL "https://api.github.com/gists?access_token=%s"


Expand Down Expand Up @@ -181,8 +184,8 @@ int main(int argc, char *argv[])


if (filename == NULL) { if (filename == NULL) {
if (fakename == NULL) { if (fakename == NULL) {
fakename = (char *)malloc(15 * sizeof(char)); fakename = (char *)malloc((strlen(DEFAULT_STDIN_FILENAME) + 1) * sizeof(char));
strcpy(fakename, "default.txt"); strcpy(fakename, DEFAULT_STDIN_FILENAME);
} }
content = user_input(); content = user_input();
} else { } else {
Expand Down

0 comments on commit 8680b89

Please sign in to comment.