Commit 9b2d2f2e13
Verified · cmc
Layout: unified · split
c/guess.c +1 −1
| @@ -24,7 +24,7 @@ int main() { | ||
| 24 | 24 | if(fgets(line, sizeof line, stdin) != NULL) |
| 25 | 25 | { |
| 26 | 26 | // Convert user input to an integer |
| 27 | int user_input = atoi(line); | |
| 27 | int user_input = (int)strtol(line, NULL, 10); | |
| 28 | 28 | |
| 29 | 29 | // Do the main comparison to determine if the guess is correct |
| 30 | 30 | if (user_input == random_number) { |
python/cat.py +1 −1
| @@ -7,7 +7,7 @@ args = parser.parse_args() | ||
| 7 | 7 | |
| 8 | 8 | # Open the file using the `file` argument |
| 9 | 9 | path = args.file |
| 10 | with open(path, 'r') as file: | |
| 10 | with open(path, 'r', encoding='utf-8') as file: | |
| 11 | 11 | # Read and print the file contents |
| 12 | 12 | contents = file.read() |
| 13 | 13 | print(contents) |