From cba867f20282576a947b2c7f2396cc7b62be655a Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Fri, 4 Apr 2014 20:14:58 +0200 Subject: [PATCH] Final (?) fixes to git versioning https://github.com/Proxmark/proxmark3/issues/10 --- armsrc/appmain.c | 2 +- armsrc/util.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/armsrc/appmain.c b/armsrc/appmain.c index 7af47a51..b6c32200 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -336,7 +336,7 @@ extern struct version_information version_information; extern char *_bootphase1_version_pointer, _flash_start, _flash_end; void SendVersion(void) { - char temp[48]; /* Limited data payload in USB packets */ + char temp[256]; /* Limited data payload in USB packets */ DbpString("Prox/RFID mark3 RFID instrument"); /* Try to find the bootrom version information. Expect to find a pointer at diff --git a/armsrc/util.c b/armsrc/util.c index a250e529..2d3aab9c 100644 --- a/armsrc/util.c +++ b/armsrc/util.c @@ -227,27 +227,27 @@ void FormatVersionInformation(char *dst, int len, const char *prefix, void *vers dst[0] = 0; strncat(dst, prefix, len); if(v->magic != VERSION_INFORMATION_MAGIC) { - strncat(dst, "Missing/Invalid version information", len); + strncat(dst, "Missing/Invalid version information", len - strlen(dst) - 1); return; } if(v->versionversion != 1) { - strncat(dst, "Version information not understood", len); + strncat(dst, "Version information not understood", len - strlen(dst) - 1); return; } if(!v->present) { - strncat(dst, "Version information not available", len); + strncat(dst, "Version information not available", len - strlen(dst) - 1); return; } - strncat(dst, v->gitversion, len); + strncat(dst, v->gitversion, len - strlen(dst) - 1); if(v->clean == 0) { - strncat(dst, "-unclean", len); + strncat(dst, "-unclean", len - strlen(dst) - 1); } else if(v->clean == 2) { - strncat(dst, "-suspect", len); + strncat(dst, "-suspect", len - strlen(dst) - 1); } - strncat(dst, " ", len); - strncat(dst, v->buildtime, len); + strncat(dst, " ", len - strlen(dst) - 1); + strncat(dst, v->buildtime, len - strlen(dst) - 1); } // ------------------------------------------------------------------------- -- 2.39.5