X-Git-Url: https://the.earth.li/gitweb/?a=blobdiff_plain;f=keyd.c;h=9994dea303b812588fe00ff9d18cec5424ce8668;hb=37801dca09e004c214604ae66323a628e100258d;hp=c1c2d5080d280d30b3e6f9f83db7a533e5f58d2a;hpb=0e9ae75e964c98041e5d8279efacd96282c703ac;p=onak.git diff --git a/keyd.c b/keyd.c index c1c2d50..9994dea 100644 --- a/keyd.c +++ b/keyd.c @@ -13,14 +13,15 @@ * more details. * * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 51 - * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * this program. If not, see . */ #include #include #include +#include #include +#include #include #include #include @@ -31,7 +32,7 @@ #include #include -#include "config.h" +#include "build-config.h" #ifdef HAVE_SYSTEMD #include @@ -47,7 +48,6 @@ #include "mem.h" #include "onak-conf.h" #include "parsekey.h" -#include "version.h" /* Maximum number of clients we're prepared to accept at once */ #define MAX_CLIENTS 16 @@ -609,7 +609,7 @@ int main(int argc, char *argv[]) { int fd = -1, maxfd, i, clients[MAX_CLIENTS]; fd_set rfds = { 0 }; /* Avoid scan-build false report for FD_SET */ - char sockname[1024]; + char sockname[100]; char *configfile = NULL; bool foreground = false; int optchar; @@ -655,7 +655,8 @@ int main(int argc, char *argv[]) } stats->started = time(NULL); - snprintf(sockname, 1023, "%s/%s", config.sock_dir, KEYD_SOCKET); + snprintf(sockname, sizeof(sockname) - 1, "%s/%s", + config.sock_dir, KEYD_SOCKET); fd = sock_init(sockname); if (fd != -1) {