changeset 48219:8ad12da0cbc7

8193183: Fix format string in libdt_shmem/shmemBase.c Reviewed-by: cjplummer, sspitsyn
author clanger
date Fri, 08 Dec 2017 09:48:10 +0100
parents 7a83c7afb383
children f3b561b13ddf
files src/jdk.jdi/share/native/libdt_shmem/shmemBase.c
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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) {