and of course, if not using the m flag on fscanf, we need to pass char*, not char**
This commit is contained in:
parent
9a70b60ebd
commit
4fb42250d3
1 changed files with 3 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue