equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2005, 2015, 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 |
56 char jdk_special_version = '\0'; |
56 char jdk_special_version = '\0'; |
57 |
57 |
58 /* If the JDK_BUILD_NUMBER is of format bXX and XX is an integer |
58 /* If the JDK_BUILD_NUMBER is of format bXX and XX is an integer |
59 * XX is the jdk_build_number. |
59 * XX is the jdk_build_number. |
60 */ |
60 */ |
61 int len = strlen(jdk_build_string); |
61 size_t len = strlen(jdk_build_string); |
62 if (jdk_build_string[0] == 'b' && len >= 2) { |
62 if (jdk_build_string[0] == 'b' && len >= 2) { |
63 int i = 0; |
63 size_t i = 0; |
64 for (i = 1; i < len; i++) { |
64 for (i = 1; i < len; i++) { |
65 if (isdigit(jdk_build_string[i])) { |
65 if (isdigit(jdk_build_string[i])) { |
66 build_number[i-1] = jdk_build_string[i]; |
66 build_number[i-1] = jdk_build_string[i]; |
67 } else { |
67 } else { |
68 // invalid build number |
68 // invalid build number |
74 build_number[len-1] = '\0'; |
74 build_number[len-1] = '\0'; |
75 jdk_build_number = (unsigned int) atoi(build_number) ; |
75 jdk_build_number = (unsigned int) atoi(build_number) ; |
76 } |
76 } |
77 } |
77 } |
78 |
78 |
79 assert(jdk_build_number >= 0 && jdk_build_number <= 255); |
79 assert(jdk_build_number <= 255); |
80 |
80 |
81 if (strlen(jdk_update_string) == 2 || strlen(jdk_update_string) == 3) { |
81 if (strlen(jdk_update_string) == 2 || strlen(jdk_update_string) == 3) { |
82 if (isdigit(jdk_update_string[0]) && isdigit(jdk_update_string[1])) { |
82 if (isdigit(jdk_update_string[0]) && isdigit(jdk_update_string[1])) { |
83 update_ver[0] = jdk_update_string[0]; |
83 update_ver[0] = jdk_update_string[0]; |
84 update_ver[1] = jdk_update_string[1]; |
84 update_ver[1] = jdk_update_string[1]; |