diff mcabber/mcabber/utils.c @ 2309:e00ae0763468

Do not use litteral command char (':', '/')
author Mikael Berthe <mikael@lilotux.net>
date Sat, 11 Feb 2017 12:40:43 +0100
parents 6e1ead98930d
children 6424627913be
line wrap: on
line diff
--- a/mcabber/mcabber/utils.c	Sun Jul 26 22:45:56 2015 +0200
+++ b/mcabber/mcabber/utils.c	Sat Feb 11 12:40:43 2017 +0100
@@ -51,6 +51,7 @@
 #include "logprint.h"
 #include "settings.h"
 #include "main.h"
+#include "screen.h"
 
 static int DebugEnabled;
 static char *FName;
@@ -937,4 +938,17 @@
   return FALSE;
 }
 
+//  mkcmdstr(cmd) returns a pointer to a const string with the command
+//  prefixed with COMMAND_CHAR.
+const char *mkcmdstr(const char *cmd)
+{
+  static char fcmd[INPUTLINE_LENGTH+1];
+
+  fcmd[0] = COMMAND_CHAR;
+  fcmd[1] = 0;
+
+  strncat(fcmd+1, cmd, INPUTLINE_LENGTH-1);
+  return fcmd;
+}
+
 /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2:  For Vim users... */