From baa40e286883ba226c5dde2ff43a8123cc621020 Mon Sep 17 00:00:00 2001 From: kremlin Date: Sat, 21 Jun 2014 21:49:37 -0500 Subject: add license ISC license blurbs --- src/main.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/main.h') diff --git a/src/main.h b/src/main.h index a5fd502..a7a4273 100644 --- a/src/main.h +++ b/src/main.h @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2014 Ian Sutton + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + #include //TODO change this to config dir, not data dir -- cgit v1.2.3 From fbc0295f6d0b50482a8f636b5ceba244e195ecaa Mon Sep 17 00:00:00 2001 From: kremlin Date: Sun, 22 Jun 2014 01:11:25 -0500 Subject: change buffer size for gethostname() to HOST_NAME_MAX to avoid accidently truncating the terminating byte on systems that handle gethostname() poorly --- src/main.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/main.h') diff --git a/src/main.h b/src/main.h index a7a4273..8d1c257 100644 --- a/src/main.h +++ b/src/main.h @@ -18,20 +18,20 @@ //TODO change this to config dir, not data dir gboolean install_conf() { - gchar *our_conf_uri = "systemd-utl/xml-conf/"; - gchar **data_dir = g_get_system_data_dirs(); + gchar *our_conf_uri = "systemd-utl/xml-conf/"; + gchar **data_dir = g_get_system_data_dirs(); - if(g_strcmp0(data_dir[0], NULL)) { - const gchar our_conf_path[256]; - g_snprintf(our_conf_path, sizeof our_conf_path, "%s%s", *data_dir, our_conf_uri); - GError **errors; + if(g_strcmp0(data_dir[0], NULL)) { + const gchar our_conf_path[256]; + g_snprintf(our_conf_path, sizeof our_conf_path, "%s%s", *data_dir, our_conf_uri); + GError **errors; - /*TODO permissions w/ this */ - g_mkdir_with_parents(our_conf_path, 0644); - - return FALSE; - //return (errors[0] == NULL); + /*TODO permissions w/ this */ + g_mkdir_with_parents(our_conf_path, 0644); + + return FALSE; + //return (errors[0] == NULL); - } else - return FALSE; + } else + return FALSE; } -- cgit v1.2.3