From b0267f8b5613f39d94bcfabea233d97d17be163f Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sat, 8 Sep 2012 21:18:26 +0000 Subject: Replace obsolete bcopy, index, rindex with modern memcpy, strchr, strrchr git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1730 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- other/pamx/send.c | 2 +- other/pamx/window.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'other/pamx') diff --git a/other/pamx/send.c b/other/pamx/send.c index 5413308b..597b76c7 100644 --- a/other/pamx/send.c +++ b/other/pamx/send.c @@ -587,7 +587,7 @@ makeXImage(XImageInfo * const ximageinfoP, MALLOCARRAY(data, byteCount); if (data == NULL) pm_error("Can't allocate space for %u byte image", byteCount); - bcopy(imageP->data, data, byteCount); + memcpy(data, imageP->data, byteCount); ximageinfoP->ximageP = XCreateImage(disp, visualP, 1, XYBitmap, diff --git a/other/pamx/window.c b/other/pamx/window.c index 29f85d92..ec2a77fe 100644 --- a/other/pamx/window.c +++ b/other/pamx/window.c @@ -499,10 +499,10 @@ iconName(const char * const s) { char * t; STRSCPY(buf, s); - /* strip off stuff following 1st word. This strips + /* chop off stuff following 1st word. This strips info added by processing functions too. */ - t = index(buf, ' '); + t = strchr(buf, ' '); if (t) *t = '\0'; @@ -510,15 +510,15 @@ iconName(const char * const s) { You might want to change this. */ - t= rindex(buf, '/'); + t= strrchr(buf, '/'); if (t) { char * p; for (p = buf, ++t; *t; ++p, ++t) *p = *t; *p = '\0'; } - /* look for an extension and strip it off */ - t = index(buf, '.'); + /* Chop off any filename extension */ + t = strchr(buf, '.'); if (t) *t = '\0'; } -- cgit 1.4.1