diff src/java.smartcardio/share/native/libj2pcsc/pcsc.c @ 51794:dccdf51b10dd

8207233: Minor improvements of jdk C-coding Reviewed-by: rriggs, prr
author goetz
date Fri, 13 Jul 2018 17:42:24 +0200
parents 71c04702a3d5
children df3d253aaf81
line wrap: on
line diff
--- a/src/java.smartcardio/share/native/libj2pcsc/pcsc.c	Fri Jul 13 13:00:36 2018 -0700
+++ b/src/java.smartcardio/share/native/libj2pcsc/pcsc.c	Fri Jul 13 17:42:24 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, 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
@@ -192,7 +192,7 @@
     }
     dprintf1("-size: %d\n", size);
 
-    if (size) {
+    if (size != 0) {
         mszReaders = malloc(size);
         if (mszReaders == NULL) {
             throwOutOfMemoryError(env, NULL);
@@ -205,6 +205,8 @@
             return NULL;
         }
         dprintf1("-String: %s\n", mszReaders);
+    } else {
+      return NULL;
     }
 
     result = pcsc_multi2jstring(env, mszReaders);