diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2013-09-15 09:51:11 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2013-09-15 09:51:11 +0200 |
commit | 0d463906c72e07d7c0679f1f1843dae9b2e63715 (patch) | |
tree | 73a650c0080194448f554cdc8140765000610f46 /src | |
parent | c411c1f2acb1057ee705a8ff163ad0892d5e21cf (diff) |
Drop use of asprintf (not supported on win32)
Diffstat (limited to 'src')
-rw-r--r-- | src/versionstr.cc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/versionstr.cc b/src/versionstr.cc index 3ef09e2..e90caa8 100644 --- a/src/versionstr.cc +++ b/src/versionstr.cc @@ -78,12 +78,10 @@ void VersionStr::set(std::string v) throw(const char *) VersionStr::operator std::string() const { std::string v; - char *buf; - size_t sz; - if(patch()) sz = asprintf(&buf, "%d.%d.%d", major(), minor(), patch()); - else sz = asprintf(&buf, "%d.%d", major(), minor()); - if(sz) v = buf; - free(buf); + char buf[64]; + if(patch()) sprintf(buf, "%d.%d.%d", major(), minor(), patch()); + else sprintf(buf, "%d.%d", major(), minor()); + v = buf; return v; } |