diff options
author | Bardur Arantsson <bardur@scientician.net> | 2010-01-10 19:30:28 +0100 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2010-01-10 19:32:02 +0100 |
commit | 20087ac085b472a1238ac0ca78a2cd9d4e24c18d (patch) | |
tree | 5df1ecde8d61a979e58c329a3eab711581620aca /src/notes.c | |
parent | d324d9c0ac98e74db26e5dd5c6e379c1fc18cff3 (diff) |
Fixes for 64 bit compatibility.
- Fix skill value display in character dump on 64 bit machines.
- Fix format strings and add casts to *printf() invocations.
Diffstat (limited to 'src/notes.c')
-rw-r--r-- | src/notes.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/notes.c b/src/notes.c index 8cfc08ae..11b1ed4f 100644 --- a/src/notes.c +++ b/src/notes.c @@ -94,8 +94,8 @@ void add_note(char *note, char code) strncpy(buf, note, 60); /* Get date and time */ - sprintf(long_day, "%ld:%02ld %s, %s", (bst(HOUR, turn) % 12 == 0) ? 12 : (bst(HOUR, turn) % 12), - bst(MINUTE, turn), (bst(HOUR, turn) < 12) ? "AM" : "PM", get_month_name(bst(DAY, turn), FALSE, + sprintf(long_day, "%ld:%02ld %s, %s", (long int) ((bst(HOUR, turn) % 12 == 0) ? 12 : (bst(HOUR, turn) % 12)), + (long int) bst(MINUTE, turn), (bst(HOUR, turn) < 12) ? "AM" : "PM", get_month_name(bst(DAY, turn), FALSE, FALSE)); /* Get depth */ @@ -124,8 +124,8 @@ void add_note_type(int note_number) strftime(true_long_day, 30, "%Y-%m-%d at %H:%M:%S", localtime(&ct)); /* Get the date */ - sprintf(buf, "%ld", bst(YEAR, turn) + START_YEAR); - sprintf(long_day, "%ld:%02ld %s the %s of III %s", (bst(HOUR, turn) % 12 == 0) ? 12 : (bst(HOUR, turn) % 12), bst(MINUTE, turn), (bst(HOUR, turn) < 12) ? "AM" : "PM", get_month_name(bst(DAY, turn), FALSE, FALSE), buf); + sprintf(buf, "%ld", (long int) (bst(YEAR, turn) + START_YEAR)); + sprintf(long_day, "%ld:%02ld %s the %s of III %s", (long int) ((bst(HOUR, turn) % 12 == 0) ? 12 : (bst(HOUR, turn) % 12)), (long int) bst(MINUTE, turn), (bst(HOUR, turn) < 12) ? "AM" : "PM", get_month_name(bst(DAY, turn), FALSE, FALSE), buf); /* Work out what to do */ switch (note_number) |