diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2019-03-18 05:06:06 -0400 |
---|---|---|
committer | Adam Jackson <ajax@nwnk.net> | 2019-04-02 19:17:16 +0000 |
commit | 38c5ee4f77c1d837ed8936bad5a3a354701aaed2 (patch) | |
tree | cd0a771068f2ce1df879daa90ea06d6bb25c632b /src | |
parent | 91c08f4d9cb915d5f7c3074db3e72ad15ec14c01 (diff) |
bzero was marked "legacy" in POSIX 2001, and is not part of the later revisions.
Use memset, which is standard (and supported for some 30 years).
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/Error.c | 4 | ||||
-rw-r--r-- | src/Initialize.c | 2 | ||||
-rw-r--r-- | src/Resources.c | 4 | ||||
-rw-r--r-- | src/TMkey.c | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/src/Error.c b/src/Error.c index 50f6c3c..18a80b5 100644 --- a/src/Error.c +++ b/src/Error.c @@ -251,7 +251,7 @@ static void DefaultMsg ( String par[10]; if (i > 10) i = 10; (void) memmove((char*)par, (char*)params, i * sizeof(String) ); - bzero( &par[i], (10-i) * sizeof(String) ); + memset( &par[i], 0, (10-i) * sizeof(String) ); (void) fprintf (stderr, "%s%s", error ? XTERROR_PREFIX : XTWARNING_PREFIX, error ? "Error: " : "Warning: "); @@ -286,7 +286,7 @@ program as a non-root user or by removing the suid bit on the executable."); String par[10]; if (i > 10) i = 10; (void) memmove((char*)par, (char*)params, i * sizeof(String) ); - bzero( &par[i], (10-i) * sizeof(String) ); + memset( &par[i], 0, (10-i) * sizeof(String) ); if (i != *num_params) XtWarning( "Some arguments in following message were lost" ); /* diff --git a/src/Initialize.c b/src/Initialize.c index 61c8575..a9b8844 100644 --- a/src/Initialize.c +++ b/src/Initialize.c @@ -737,7 +737,7 @@ static Boolean _GetResource( return True; } else { WidgetRec widget; /* hack, hack */ - bzero( &widget, sizeof(widget) ); + memset( &widget, 0, sizeof(widget) ); widget.core.self = &widget; widget.core.widget_class = coreWidgetClass; widget.core.screen = (Screen*)DefaultScreenOfDisplay(dpy); diff --git a/src/Resources.c b/src/Resources.c index 29cbbf0..562aac9 100644 --- a/src/Resources.c +++ b/src/Resources.c @@ -519,8 +519,8 @@ static XtCacheRef *GetResources( } /* Mark each resource as not found on arg list */ - bzero((char *) found, (size_t) (num_resources * sizeof(Boolean))); - bzero((char *) typed, (size_t) (num_resources * sizeof(int))); + memset((char *) found, 0, (size_t) (num_resources * sizeof(Boolean))); + memset((char *) typed, 0, (size_t) (num_resources * sizeof(int))); /* Copy the args into the resources, mark each as found */ { diff --git a/src/TMkey.c b/src/TMkey.c index e59bcca..864b6ec 100644 --- a/src/TMkey.c +++ b/src/TMkey.c @@ -86,7 +86,7 @@ in this Software without prior written authorization from The Open Group. #endif #define FLUSHKEYCACHE(ctx) \ - bzero((char *)&ctx->keycache, sizeof(TMKeyCache)) + memset((char *)&ctx->keycache, 0, sizeof(TMKeyCache)) /* * The following array reorders the modifier bits so that the most common ones |