]> git.proxmox.com Git - spiceterm.git/blobdiff - spiceterm.c
buildsys: update make upload target for stretch
[spiceterm.git] / spiceterm.c
index 5149bbf6bcda83030f94d98146791ebc18c59e0f..bcb38c6593c0105cee5ded71b10a9514085bbc9f 100644 (file)
@@ -51,8 +51,6 @@
 #include <spice/macros.h>
 #include <spice/qxl_dev.h>
 
-#include <gdk/gdkkeysyms.h>
-
 #include "event_loop.h"
 #include "translations.h"
 
@@ -1234,7 +1232,11 @@ spiceterm_puts(spiceTerm *vt, const char *buf, int len)
                     vt->utf_char = (vt->utf_char << 6) | (c & 0x3f);
                     vt->utf_count--;
                     if (vt->utf_count == 0) {
-                        tc = vt->utf_char;
+                       if (vt->utf_char <= G_MAXUINT16) {
+                           tc = vt->utf_char;
+                       } else {
+                           tc = 0;
+                       }
                     } else {
                         continue;
                     }
@@ -1613,6 +1615,7 @@ spiceterm_print_usage(const char *msg)
     fprintf(stderr, "  --addr <addr>        Bind to address <addr>\n");
     fprintf(stderr, "  --sasl               Enable SASL based authentication\n");
     fprintf(stderr, "  --noauth             Disable authentication\n");
+    fprintf(stderr, "  --keymap             Spefify keymap (uses kvm keymap files)\n");
 }
 
 int
@@ -1633,20 +1636,19 @@ main (int argc, char** argv)
         .sasl = FALSE,
     };
 
-    g_thread_init(NULL);
-
-    static struct option long_options[] = {
+   static struct option long_options[] = {
         { "timeout", required_argument, 0,  't' },
         { "authpath", required_argument, 0, 'A' },
         { "permissions", required_argument, 0, 'P' },
         { "port", required_argument, 0, 'p' },
         { "addr", required_argument, 0, 'a' },
+        { "keymap", required_argument, 0, 'k' },
         { "noauth", no_argument, 0, 'n' },
         { "sasl", no_argument, 0, 's' },
         { NULL, 0, 0, 0 },
     };
 
-    while ((c = getopt_long(argc, argv, "nst:a:p:P:", long_options, NULL)) != -1) {
+    while ((c = getopt_long(argc, argv, "nkst:a:p:P:", long_options, NULL)) != -1) {
         
         switch (c) {
         case 'n':
@@ -1655,6 +1657,9 @@ main (int argc, char** argv)
         case 's':
             opts.sasl = TRUE;
             break;
+        case 'k':
+            opts.keymap = optarg;
+            break;
         case 'A':
             pve_auth_set_path(optarg);
             break;
@@ -1681,11 +1686,13 @@ main (int argc, char** argv)
     }
  
     if (optind < argc) {
-        command = argv[optind+1];
-        cmdargv = &argv[optind+1];
+        command = argv[optind];
+        cmdargv = &argv[optind];
     }
-    
+
     spiceTerm *vt = spiceterm_create(744, 400, &opts);
+    if (!vt)
+        exit(-1);
 
     setlocale(LC_ALL, ""); // set from environment