and of course, if not using the m flag on fscanf, we need to pass char*, not char**

This commit is contained in:
Tim Felgentreff 2015-12-08 11:45:01 +01:00
parent 9a70b60ebd
commit 4fb42250d3

View file

@ -65,8 +65,8 @@ int main(int argc, char * argv[]) {
if ( file ) {
new_ver[4] = 1;
git_rev = (char*)calloc(sizeof(char), 1024);
if (fscanf(file, "ref: %s", &git_rev) != 1 ) {
if (fscanf(file, "%s", &git_rev) != 1 ) {
if (fscanf(file, "ref: %s", git_rev) != 1 ) {
if (fscanf(file, "%s", git_rev) != 1 ) {
new_ver[4] = -1;
}
fclose(file);
@ -79,7 +79,7 @@ int main(int argc, char * argv[]) {
free(gitrevfile);
if (file) {
git_rev = (char*)calloc(sizeof(char), 1024);
if (fscanf(file, "%s", &git_rev) != 1) {
if (fscanf(file, "%s", git_rev) != 1) {
new_ver[4] = -1;
}
fclose(file);