Improve code portability ahead of Windows support

This commit is contained in:
Lovell Fuller 2015-04-05 21:57:53 +01:00
parent 7ad7193b1e
commit ce6813329b
2 changed files with 2 additions and 2 deletions

View File

@ -856,7 +856,7 @@ class ResizeWorker : public NanAsyncWorker {
argv[2] = info; argv[2] = info;
} else { } else {
// Add file size to info // Add file size to info
struct stat st; GStatBuf st;
g_stat(baton->output.c_str(), &st); g_stat(baton->output.c_str(), &st);
info->Set(NanNew<String>("size"), NanNew<Uint32>(static_cast<uint32_t>(st.st_size))); info->Set(NanNew<String>("size"), NanNew<Uint32>(static_cast<uint32_t>(st.st_size)));
argv[1] = info; argv[1] = info;

View File

@ -76,7 +76,7 @@ NAN_METHOD(counters) {
NAN_METHOD(libvipsVersion) { NAN_METHOD(libvipsVersion) {
NanScope(); NanScope();
char version[9]; char version[9];
snprintf(version, sizeof(version), "%d.%d.%d", vips_version(0), vips_version(1), vips_version(2)); g_snprintf(version, sizeof(version), "%d.%d.%d", vips_version(0), vips_version(1), vips_version(2));
NanReturnValue(NanNew<String>(version)); NanReturnValue(NanNew<String>(version));
} }