aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkaiwu <kaiwu2004@gmail.com>2022-04-11 23:09:31 +0800
committerkaiwu <kaiwu2004@gmail.com>2022-04-11 23:09:31 +0800
commit97c4b76070e39fc453af74655a87cc19b42baa3a (patch)
tree0bab16a52c390b3d642f4be1b3cdcc8bc7ff8cad /src
parenta2ff02097589cac67b5fa5b301e6449ebd4ac443 (diff)
downloadadvent-of-code-97c4b76070e39fc453af74655a87cc19b42baa3a.tar.gz
advent-of-code-97c4b76070e39fc453af74655a87cc19b42baa3a.zip
fix lld issue
Diffstat (limited to 'src')
-rw-r--r--src/2016/day5/aoc.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/2016/day5/aoc.cpp b/src/2016/day5/aoc.cpp
index 024a9ff..e141407 100644
--- a/src/2016/day5/aoc.cpp
+++ b/src/2016/day5/aoc.cpp
@@ -8,14 +8,14 @@ void day5(const char* secret, int len, char pass1[], char pass2[]) {
char buf[128] = {0};
int l = strlen(secret);
memcpy(buf, secret, len);
- int64_t i = 0;
+ int i = 0;
int x1 = len;
int x2 = 0;
- while (i < INT64_MAX && x2 < 8) {
- sprintf(buf + l, "%lld", i);
+ while (i < INT32_MAX && x2 < 8) {
+ sprintf(buf + l, "%d", i);
char* hash = md5sum(buf);
if (lead_zeros(hash) >= 5) {
- printf("%lld %s\n", i, hash);
+ printf("%d %s\n", i, hash);
if (x1 > 0) {
pass1[len - x1] = hash[5];
x1--;