diff --git a/ntop.c b/ntop.c index 6a95358..c1cafc3 100644 --- a/ntop.c +++ b/ntop.c @@ -1700,7 +1700,7 @@ int _tmain(int argc, TCHAR *argv[]) TCHAR *Context; TCHAR *Token = _tcstok_s(argv[i], Delim, &Context); while(Token && NameFilterCount < MAX_NAMEPARTS) { - strcpy_s(NameFilterList[NameFilterCount++], sizeof(Token) < MAX_NAMEPARTSIZE ? sizeof(Token) : MAX_NAMEPARTSIZE, Token); + _tcsncpy_s(NameFilterList[NameFilterCount++], MAX_NAMEPARTSIZE+1, Token, MAX_NAMEPARTSIZE); Token = _tcstok_s(0, Delim, &Context); }