Commit c54302de authored by Axel Auweter's avatar Axel Auweter
Browse files

Fix getopt usage througout the entire project (getopt returns int, not char!)

parent a13298c8
......@@ -144,9 +144,9 @@ int main(int argc, char* const argv[]) {
signal(SIGTERM, abrtHandler);
/* Parse command line */
char ret;
int ret;
host="localhost";
while ((ret=getopt(argc, argv, "h:?"))!=EOF) {
while ((ret=getopt(argc, argv, "h:?"))!=-1) {
switch(ret) {
case 'h':
host = optarg;
......
......@@ -32,9 +32,9 @@ int main(int argc, char* argv[])
exit(EXIT_FAILURE);
}
char ret;
int ret;
const char *host = "localhost";
while ((ret=getopt(argc, argv, "+h:"))!=EOF) {
while ((ret=getopt(argc, argv, "+h:"))!=-1) {
switch(ret) {
case 'h':
host = optarg;
......
......@@ -43,10 +43,10 @@ int main(int argc, char* argv[])
}
/* Get the options */
char ret;
int ret;
const char *host = "localhost";
bool raw = false;
while ((ret=getopt(argc, argv, "+h:r"))!=EOF) {
while ((ret=getopt(argc, argv, "+h:r"))!=-1) {
switch(ret) {
case 'h':
host = optarg;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment