8228468: awt_Robot.c : format string contains 0 within the string body
authormbaesken
Mon, 22 Jul 2019 10:15:46 +0200
changeset 57480 321bddd9afdf
parent 57479 d999a1a11485
child 57481 aaa83519e723
8228468: awt_Robot.c : format string contains 0 within the string body Reviewed-by: serb
src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c
--- a/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c	Tue Jul 23 00:29:31 2019 -0400
+++ b/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c	Mon Jul 22 10:15:46 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2019, 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
@@ -150,7 +150,7 @@
 static jboolean isXCompositeDisplay(Display *display, int screenNumber) {
 
     char NET_WM_CM_Sn[25];
-    snprintf(NET_WM_CM_Sn, sizeof(NET_WM_CM_Sn), "_NET_WM_CM_S%d\0", screenNumber);
+    snprintf(NET_WM_CM_Sn, sizeof(NET_WM_CM_Sn), "_NET_WM_CM_S%d", screenNumber);
 
     Atom managerSelection = XInternAtom(display, NET_WM_CM_Sn, 0);
     Window owner = XGetSelectionOwner(display, managerSelection);