|
|
| version 1.6, 2025/04/10 01:24:38 | version 1.7, 2025/04/13 04:22:43 |
|---|---|
| Line 24 | Line 24 |
| * along with FreeM. If not, see <https://www.gnu.org/licenses/>. | * along with FreeM. If not, see <https://www.gnu.org/licenses/>. |
| * | * |
| * $Log$ | * $Log$ |
| * Revision 1.7 2025/04/13 04:22:43 snw | |
| * Fix snprintf calls | |
| * | |
| * Revision 1.6 2025/04/10 01:24:38 snw | * Revision 1.6 2025/04/10 01:24:38 snw |
| * Remove C++ style comments | * Remove C++ style comments |
| * | * |
| Line 94 short jnl_init(char *jnlfile, char *host | Line 97 short jnl_init(char *jnlfile, char *host |
| jnl_desc = open (jnl_file_path, O_CREAT | O_APPEND | O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO); | jnl_desc = open (jnl_file_path, O_CREAT | O_APPEND | O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO); |
| snprintf (tmsg, 255, "error creating new journal file '%s' [errno %d: '%s']", jnl_file_path, errno, strerror (errno)); | snprintf (tmsg, sizeof (tmsg) - 1, "error creating new journal file '%s' [errno %d: '%s']", jnl_file_path, errno, strerror (errno)); |
| if (jnl_desc == -1) jnl_panic (tmsg); | if (jnl_desc == -1) jnl_panic (tmsg); |
| jnl_lock (); | jnl_lock (); |
| memcpy (hdr.magic, m, 5); | memcpy (hdr.magic, m, 5); |
| hdr.fmt_version = FRM_JNL_VERSION; | hdr.fmt_version = FRM_JNL_VERSION; |
| snprintf (hdr.host_triplet, 40, "%s", HOST); | snprintf (hdr.host_triplet, sizeof (hdr.host_triplet) - 1, "%s", HOST); |
| if (write (jnl_desc, &hdr, sizeof (jnl_hdr_t)) == -1) { | if (write (jnl_desc, &hdr, sizeof (jnl_hdr_t)) == -1) { |
| snprintf (tmsg, 255, "error %d writing to journal file", errno); | snprintf (tmsg, sizeof (tmsg) - 1, "error %d writing to journal file", errno); |
| jnl_panic (tmsg); | jnl_panic (tmsg); |
| } | } |
| Line 226 short jnl_ent_write(short action, char * | Line 229 short jnl_ent_write(short action, char * |
| switch (errno) { | switch (errno) { |
| case ENOSPC: | case ENOSPC: |
| snprintf (msg, 255, "ran out of disk space while attempting journal write"); | snprintf (msg, sizeof (msg) - 1, "ran out of disk space while attempting journal write"); |
| break; | break; |
| default: | default: |
| snprintf (msg, 255, "%s", strerror (errno)); | snprintf (msg, sizeof (msg) - 1, "%s", strerror (errno)); |
| break; | break; |
| } | } |