From 9d7ac87af302ebe913190b56f10de1bfe3032ba1 Mon Sep 17 00:00:00 2001 From: Brian Barto Date: Thu, 12 May 2016 15:06:35 -0400 Subject: [PATCH] Bug fix for UTF-8 character support on ubuntu. Needed to link to the ncursesw library. modified: Makefile modified: README.md modified: src/nms.c --- Makefile | 4 ++-- README.md | 6 +++--- src/nms.c | 5 +---- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 0d8d8ce..ee0463f 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ SRC=src CC = gcc CFLAGS = -Wextra -Wall -LDLIBS = -lncurses +LDLIBS = -lncursesw NCURSES_H = /usr/include/ncurses.h .PHONY: all install uninstall clean @@ -52,7 +52,7 @@ $(NCURSES_H): sudo pacman -S ncurses ; \ else \ sudo apt-get update ; \ - sudo apt-get install ncurses-dev ; \ + sudo apt-get install lib32ncurses5-dev lib32ncursesw5-dev ; \ fi clean: diff --git a/README.md b/README.md index 83b05ed..b1cb859 100644 --- a/README.md +++ b/README.md @@ -35,16 +35,16 @@ ls /usr/include | grep ncurses.h If the ncurses.h header file is not present, you may need to install the library. On Ubuntu, type: ``` sudo apt-get update -sudo apt-get install ncurses-dev +sudo apt-get install lib32ncurses5-dev lib32ncursesw5-dev ``` If you are using a different flavor of linux, search your available packages for "ncurses" and install -it. +it. If you see two different packages for "ncurses" and "ncursesw", install them both (as shown above +in the Ubuntu example). Next, download and build the standalone executable: ``` git clone https://github.com/bartobri/no-more-secrets.git cd ./no-more-secrets -git checkout tags/v0.1.0 make sudo make install ``` diff --git a/src/nms.c b/src/nms.c index 7c7a4d2..99f9d8a 100644 --- a/src/nms.c +++ b/src/nms.c @@ -322,7 +322,6 @@ char *getMaskChar(void) { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", - /* "\xc3\x87", "\xc3\xbc", "\xc3\xa9", "\xc3\xa2", "\xc3\xa4", "\xc3\xa0", "\xc3\xa5", "\xc3\xa7", "\xc3\xaa", "\xc3\xab", "\xc3\xa8", "\xc3\xaf", "\xc3\xae", "\xc3\xac", "\xc3\x84", "\xc3\x85", "\xc3\x89", "\xc3\xa6", @@ -350,11 +349,9 @@ char *getMaskChar(void) { "\xe2\x89\xa1", "\xe2\x89\xa5", "\xe2\x89\xa4", "\xe2\x8c\xa0", "\xe2\x8c\xa1", "\xe2\x89\x88", "\xe2\x88\x99", "\xe2\x88\x9a", "\xe2\x81\xbf", "\xe2\x96\xa0" - */ }; - //return maskChars[rand() % 218]; - return maskChars[rand() % 90]; + return maskChars[rand() % 218]; } /*