diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2019-11-04 15:27:13 +0100 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2019-11-05 16:32:20 +0100 |
commit | c820c98f2ad21721f50329c91431863ce9e84894 (patch) | |
tree | e1f7fd667a5cf39c7e3e1922e04497cc63ac1ccb | |
parent | 8eb20013abb96f4f6aade7df5327a236d48e305e (diff) | |
download | NetworkManager-c820c98f2ad21721f50329c91431863ce9e84894.tar.gz |
clients: draw border around qr code on linux console
Scanners won't recognize it on black background otherwise.
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/327
-rw-r--r-- | clients/common/nm-client-utils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clients/common/nm-client-utils.c b/clients/common/nm-client-utils.c index f63d3c7d30..4d356edbbe 100644 --- a/clients/common/nm-client-utils.c +++ b/clients/common/nm-client-utils.c @@ -561,9 +561,9 @@ nmc_print_qrcode (const char *str) if (term_linux) { /* G1 alternate character set on Linux console. */ - for (y = 0; y < size; y += 1) { + for (y = -1; y < size + 1; y += 1) { g_print (" \033[37;40;1m\016"); - for (x = 0; x < size; x++) { + for (x = -1; x < size + 1; x++) { g_print ( qrcodegen_getModule (qrcode, x, y) ? " " : "\060\060"); } |