mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 18:40:16 +02:00
Use std::snprintf to concat libvips version parts
This commit is contained in:
parent
946976ba8f
commit
3b22640077
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <cstdio>
|
||||||
|
|
||||||
#include <napi.h>
|
#include <napi.h>
|
||||||
#include <vips/vips8>
|
#include <vips/vips8>
|
||||||
@ -92,7 +93,7 @@ Napi::Value simd(const Napi::CallbackInfo& info) {
|
|||||||
*/
|
*/
|
||||||
Napi::Value libvipsVersion(const Napi::CallbackInfo& info) {
|
Napi::Value libvipsVersion(const Napi::CallbackInfo& info) {
|
||||||
char version[9];
|
char version[9];
|
||||||
g_snprintf(version, sizeof(version), "%d.%d.%d", vips_version(0), vips_version(1), vips_version(2));
|
std::snprintf(version, sizeof(version), "%d.%d.%d", vips_version(0), vips_version(1), vips_version(2));
|
||||||
return Napi::String::New(info.Env(), version);
|
return Napi::String::New(info.Env(), version);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user