diff --git a/src/share/vm/services/attachListener.cpp b/src/share/vm/services/attachListener.cpp index 5df54c84317af3b4a24c5d4d98ddee3b5308f80d..45d930d0d259491cb43190a5810fe6622956c2d8 100644 --- a/src/share/vm/services/attachListener.cpp +++ b/src/share/vm/services/attachListener.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2016, 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 @@ -271,13 +271,17 @@ static jint set_intx_flag(const char* name, AttachOperation* op, outputStream* o // set a uintx global flag using value from AttachOperation static jint set_uintx_flag(const char* name, AttachOperation* op, outputStream* out) { uintx value; - const char* arg1; - if ((arg1 = op->arg(1)) != NULL) { - int n = sscanf(arg1, UINTX_FORMAT, &value); - if (n != 1) { - out->print_cr("flag value must be an unsigned integer"); - return JNI_ERR; - } + + const char* arg1 = op->arg(1); + if (arg1 == NULL) { + out->print_cr("flag value must be specified"); + return JNI_ERR; + } + + int n = sscanf(arg1, UINTX_FORMAT, &value); + if (n != 1) { + out->print_cr("flag value must be an unsigned integer"); + return JNI_ERR; } if (strncmp(name, "MaxHeapFreeRatio", 17) == 0) {