summaryrefslogtreecommitdiff
path: root/src/common/sysinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/sysinfo.c')
-rw-r--r--src/common/sysinfo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c
index ee8ff504a..a1dbed4d1 100644
--- a/src/common/sysinfo.c
+++ b/src/common/sysinfo.c
@@ -319,12 +319,12 @@ bool sysinfo_svn_get_revision(char **out) {
bool sysinfo_git_get_revision(char **out) {
// Only include Git support if we detected it, or we're on MSVC
#if !defined(SYSINFO_VCSTYPE) || SYSINFO_VCSTYPE == VCSTYPE_GIT || SYSINFO_VCSTYPE == VCSTYPE_UNKNOWN
- FILE *fp;
char ref[128], filepath[128], line[128];
strcpy(ref, "HEAD");
while (*ref) {
+ FILE *fp;
snprintf(filepath, sizeof(filepath), ".git/%s", ref);
if ((fp = fopen(filepath, "r")) != NULL) {
if (fgets(line, sizeof(line)-1, fp) == NULL) {