Skip to content
Snippets Groups Projects
Commit 7eb1c75d authored by Wesley W. Terpstra's avatar Wesley W. Terpstra
Browse files

Nice! There are C89 methods for unsigned conversion. This fixes a long standing overflow problem.

parent fe018e9e
Branches
Tags
No related merge requests found
......@@ -60,10 +60,10 @@ int main(int argc, const char** argv) {
}
netaddress = argv[1];
address = strtoll(argv[2], 0, 0);
address = strtoull(argv[2], 0, 0);
if (argc == 4)
format = strtol(argv[3], 0, 0);
format = strtoul(argv[3], 0, 0);
else
format = EB_DATAX;
......
......@@ -72,8 +72,8 @@ int main(int argc, const char** argv) {
}
port = argv[1];
handler.base = strtol(argv[2], 0, 0);
handler.mask = strtol(argv[3], 0, 0);
handler.base = strtoull(argv[2], 0, 0);
handler.mask = strtoull(argv[3], 0, 0);
handler.data = 0;
handler.read = &my_read;
......
......@@ -61,11 +61,11 @@ int main(int argc, const char** argv) {
}
netaddress = argv[1];
address = strtoll(argv[2], 0, 0);
data = strtoll(argv[3], 0, 0);
address = strtoull(argv[2], 0, 0);
data = strtoull(argv[3], 0, 0);
if (argc == 5)
format = strtol(argv[4], 0, 0);
format = strtoul(argv[4], 0, 0);
else
format = EB_DATAX;
......
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