diff --git a/daemon/commands/register-status.cc b/daemon/commands/register-status.cc index 16e767117..0c21eaac7 100644 --- a/daemon/commands/register-status.cc +++ b/daemon/commands/register-status.cc @@ -65,8 +65,8 @@ void RegisterStatusCommand::exec(Daemon *app, const char *args) { } app->sendResponse(response); } else { + ist.clear(); ist.str(param); - ist.seekg(0); ist >> pid; if (ist.fail()) { app->sendResponse(Response("Incorrect parameter.", Response::Error)); diff --git a/daemon/commands/unregister.cc b/daemon/commands/unregister.cc index 4df79be21..60acb6b02 100644 --- a/daemon/commands/unregister.cc +++ b/daemon/commands/unregister.cc @@ -32,8 +32,8 @@ void UnregisterCommand::exec(Daemon *app, const char *args) { } } } else { + ist.clear(); ist.str(param); - ist.seekg(0); ist >> pid; if (ist.fail()) { app->sendResponse(Response("Incorrect parameter.", Response::Error));