mirror of
https://github.com/sogou/workflow.git
synced 2026-02-08 01:33:17 +08:00
Resolve a warning in g++11
This commit is contained in:
@@ -75,7 +75,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
struct sockaddr_un sun = { };
|
||||
sun.sun_family = AF_UNIX;
|
||||
strncpy(sun.sun_path, path, sizeof sun.sun_path);
|
||||
strncpy(sun.sun_path, path, sizeof sun.sun_path - 1);
|
||||
WFTutorialTask *task = MyFactory::create_tutorial_task(
|
||||
(struct sockaddr *)&sun, sizeof sun,
|
||||
0,
|
||||
|
||||
@@ -68,7 +68,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
sun.sun_family = AF_UNIX;
|
||||
strncpy(sun.sun_path, argv[1], sizeof sun.sun_path);
|
||||
strncpy(sun.sun_path, argv[1], sizeof sun.sun_path - 1);
|
||||
|
||||
signal(SIGINT, sig_handler);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user