version 1.5, 2025/04/09 19:52:02
|
version 1.6, 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.6 2025/04/13 04:22:43 snw |
|
* Fix snprintf calls |
|
* |
* Revision 1.5 2025/04/09 19:52:02 snw |
* Revision 1.5 2025/04/09 19:52:02 snw |
* Eliminate as many warnings as possible while building with -Wall |
* Eliminate as many warnings as possible while building with -Wall |
* |
* |
Line 70 void ns_error(char *ns, char *e)
|
Line 73 void ns_error(char *ns, char *e)
|
{ |
{ |
char msg_buf[256]; |
char msg_buf[256]; |
|
|
snprintf(msg_buf, 256, "error switching to namespace '%s': %s (possibly a configuration error?)\r\n\201", ns, e); |
snprintf(msg_buf, sizeof (msg_buf) - 1, "error switching to namespace '%s': %s (possibly a configuration error?)\r\n\201", ns, e); |
write_m(msg_buf); |
write_m(msg_buf); |
|
|
return; |
return; |
Line 98 void set_namespace(char *ns, int verbose
|
Line 101 void set_namespace(char *ns, int verbose
|
get_conf (ns, "root", nsroot); |
get_conf (ns, "root", nsroot); |
|
|
if(!file_exists (config_file)) { |
if(!file_exists (config_file)) { |
snprintf (tmps, 256, "configuration file '%s' does not exist.\n", config_file); |
snprintf (tmps, sizeof (tmps) - 1, "configuration file '%s' does not exist.\n", config_file); |
ns_error (ns, tmps); |
ns_error (ns, tmps); |
|
|
cleanup (); |
cleanup (); |
Line 155 void set_namespace(char *ns, int verbose
|
Line 158 void set_namespace(char *ns, int verbose
|
|
|
} |
} |
else { |
else { |
snprintf (tmps, 256, "invalid journal_mode '%s'", ns_buf); |
snprintf (tmps, sizeof (tmps) - 1, "invalid journal_mode '%s'", ns_buf); |
ns_error ("SYSTEM", tmps); |
ns_error ("SYSTEM", tmps); |
|
|
goto jour_end; |
goto jour_end; |
Line 324 jour_end:
|
Line 327 jour_end:
|
strcpy (nsname, ns); |
strcpy (nsname, ns); |
|
|
if (verbose == TRUE) { |
if (verbose == TRUE) { |
snprintf (notif, 256, "Namespace set to '%s'\r\n\201", ns); |
snprintf (notif, sizeof (notif) - 1, "Namespace set to '%s'\r\n\201", ns); |
write_m (notif); |
write_m (notif); |
} |
} |
|
|