8193183: Fix format string in libdt_shmem/shmemBase.c
Reviewed-by: cjplummer, sspitsyn
--- a/src/jdk.jdi/share/native/libdt_shmem/shmemBase.c Thu Dec 07 21:07:12 2017 -0800
+++ b/src/jdk.jdi/share/native/libdt_shmem/shmemBase.c Fri Dec 08 09:48:10 2017 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -31,6 +31,10 @@
#include "shmemBase.h"
#include "jdwpTransport.h" /* for Packet, TransportCallback */
+#if defined(_WIN32)
+ #define PRId64 "I64d"
+#endif
+
#define MIN(x,y) ((x)<(y)?(x):(y))
/*
@@ -537,7 +541,7 @@
return SYS_NOMEM;
}
- sprintf(connection->name, "%s.%ld", transport->name, sysProcessGetID());
+ sprintf(connection->name, "%s.%" PRId64, transport->name, sysProcessGetID());
error = sysSharedMemOpen(connection->name, &connection->sharedMemory,
&connection->shared);
if (error != SYS_OK) {
@@ -601,7 +605,7 @@
return SYS_NOMEM;
}
- sprintf(connection->name, "%s.%ld", transport->name, otherPID);
+ sprintf(connection->name, "%s.%" PRId64, transport->name, otherPID);
error = sysSharedMemCreate(connection->name, sizeof(SharedMemory),
&connection->sharedMemory, &connection->shared);
if (error != SYS_OK) {