#define WEBAPP_DEFAULT_GID 5000
#define LOGGING_DEFAULT_GID 6509
#define RETURN_ERROR -1
+#define BUF_SIZE 1024
static const char *program;
{
int next_opt, opt_idx = 0;
int timeout = TIMEOUT_DEFAULT;
- char applicationId[256] = "";
- char temp_arg[256] = "";
+ char applicationId[BUF_SIZE] = "";
+ char temp_arg[BUF_SIZE] = "";
char pid[6] = "";
char op = '\0';
bool isDebugMode = false;
case 's':
case 'k':
case 'r':
- strncpy(temp_arg, optarg, strlen(optarg));
+ strncpy(temp_arg, optarg, BUF_SIZE);
+ temp_arg[BUF_SIZE-1] = '\0';
op = next_opt;
break;
}
}
if (!temp.empty()) {
- strncpy(applicationId, temp.c_str(), strlen(temp.c_str()));
+ strncpy(applicationId, temp.c_str(), BUF_SIZE);
+ applicationId[BUF_SIZE-1] = '\0';
} else {
printf("result: %s\n", "failed");
return -1;