comparison 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
comparison
equal deleted inserted replaced
0:d3109e8e5ea2 1:3c960dcb51bb
1 /* 1 /*
2 * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this 7 * published by the Free Software Foundation. Oracle designates this
190 if (handleRV(env, rv)) { 190 if (handleRV(env, rv)) {
191 return NULL; 191 return NULL;
192 } 192 }
193 dprintf1("-size: %d\n", size); 193 dprintf1("-size: %d\n", size);
194 194
195 if (size) { 195 if (size != 0) {
196 mszReaders = malloc(size); 196 mszReaders = malloc(size);
197 if (mszReaders == NULL) { 197 if (mszReaders == NULL) {
198 throwOutOfMemoryError(env, NULL); 198 throwOutOfMemoryError(env, NULL);
199 return NULL; 199 return NULL;
200 } 200 }
203 if (handleRV(env, rv)) { 203 if (handleRV(env, rv)) {
204 free(mszReaders); 204 free(mszReaders);
205 return NULL; 205 return NULL;
206 } 206 }
207 dprintf1("-String: %s\n", mszReaders); 207 dprintf1("-String: %s\n", mszReaders);
208 } else {
209 return NULL;
208 } 210 }
209 211
210 result = pcsc_multi2jstring(env, mszReaders); 212 result = pcsc_multi2jstring(env, mszReaders);
211 free(mszReaders); 213 free(mszReaders);
212 return result; 214 return result;