Skip to content

Commit

Permalink
Fixed xpass initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
kala13x committed Apr 29, 2023
1 parent 4b039ad commit e87284a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# https://github.com/kala13x/smake #
####################################

CFLAGS = -g -O2 -Wall -D_XUTILS_DEBUG -D_XUTILS_USE_SSL -I./src -I./media
CFLAGS = -g -O2 -Wall -D_XUTILS_DEBUG -D_XUTILS_USE_SSL -I./media -I./src
LIBS = -lpthread -lssl -lcrypto
NAME = libxutils.a
ODIR = ./obj
Expand Down Expand Up @@ -43,7 +43,7 @@ OBJS = addr.$(OBJ) \
OBJECTS = $(patsubst %,$(ODIR)/%,$(OBJS))
INSTALL_INC = /usr/local/include/xutils
INSTALL_BIN = /usr/local/lib
VPATH = ./src:./media
VPATH = ./media:./src

.c.$(OBJ):
@test -d $(ODIR) || mkdir -p $(ODIR)
Expand All @@ -57,8 +57,8 @@ install:
@test -d $(INSTALL_BIN) || mkdir -p $(INSTALL_BIN)
@install -m 0755 $(ODIR)/$(NAME) $(INSTALL_BIN)/
@test -d $(INSTALL_INC) || mkdir -p $(INSTALL_INC)
@cp -r ./src/*.h $(INSTALL_INC)/
@cp -r ./media/*.h $(INSTALL_INC)/
@cp -r ./src/*.h $(INSTALL_INC)/

.PHONY: clean
clean:
Expand Down
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ if [ -f "$LIB_CRYPTO" ] && [ -f "$LIB_SSL" ]; then
export XUTILS_USE_SSL=y
fi

if [ $OSTYPE == 'linux-gnu'* ]; then
CPU_COUNT=`cat /proc/cpuinfo | grep processor -c`
if [ $OSTYPE == linux-gnu ]; then
CPU_COUNT=$(nproc)
else
CPU_COUNT=1
fi
Expand Down
4 changes: 2 additions & 2 deletions examples/xpass.c
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ static xbool_t XPass_InitConfigFile(xpass_ctx_t *pCtx)
sAnswer[0] = XSTR_NUL;

XASSERT((fgets(sAnswer, sizeof(sAnswer), stdin)), XFALSE);
XASSERT((sAnswer[0] == 'Y' && sAnswer[0] == 'y'), XFALSE);
XASSERT((sAnswer[0] == 'Y' || sAnswer[0] == 'y'), XFALSE);

xpath_t path;
XPath_Parse(&path, pCtx->sConf);
Expand Down Expand Up @@ -830,7 +830,7 @@ static xbool_t XPass_InitConfigFile(xpass_ctx_t *pCtx)
XJSON_FreeObject(pLayoutObj);
return XFALSE;
}

xjson_writer_t writer;
XJSON_InitWriter(&writer, NULL, XSTR_MIN);
writer.nTabSize = 4; // Enable linter
Expand Down

0 comments on commit e87284a

Please sign in to comment.