mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-15 19:02:04 +00:00
19 lines
539 B
C++
19 lines
539 B
C++
#include <string.h>
|
|
#include "clearPasswordFromCommandLine.h"
|
|
|
|
void clearPasswordFromCommandLine(int argc, char ** argv)
|
|
{
|
|
for (int arg = 1; arg < argc; ++arg)
|
|
{
|
|
if (arg + 1 < argc && 0 == strcmp(argv[arg], "--password"))
|
|
{
|
|
++arg;
|
|
memset(argv[arg], 0, strlen(argv[arg]));
|
|
}
|
|
else if (0 == strncmp(argv[arg], "--password=", strlen("--password=")))
|
|
{
|
|
memset(argv[arg] + strlen("--password="), 0, strlen(argv[arg]) - strlen("--password="));
|
|
}
|
|
}
|
|
}
|