diff options
author | joerg <joerg@pkgsrc.org> | 2013-12-06 21:26:05 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2013-12-06 21:26:05 +0000 |
commit | 6a73a193ab520937f9a3c34e20d6c35dacfe0e67 (patch) | |
tree | 9af4fed9423e4a595af2d89fffcd582ac837565e /security/smaSHeM | |
parent | fb074549d3de49f06f59a64c219958ec99016d3e (diff) | |
download | pkgsrc-6a73a193ab520937f9a3c34e20d6c35dacfe0e67.tar.gz |
Don't use void * arithmetic. Fix some const issues.
Diffstat (limited to 'security/smaSHeM')
-rw-r--r-- | security/smaSHeM/distinfo | 3 | ||||
-rw-r--r-- | security/smaSHeM/patches/patch-src_smaSHeM.cpp | 71 |
2 files changed, 73 insertions, 1 deletions
diff --git a/security/smaSHeM/distinfo b/security/smaSHeM/distinfo index d55155fc288..976d9d36ecf 100644 --- a/security/smaSHeM/distinfo +++ b/security/smaSHeM/distinfo @@ -1,5 +1,6 @@ -$NetBSD: distinfo,v 1.1.1.1 2013/11/15 05:11:50 agc Exp $ +$NetBSD: distinfo,v 1.2 2013/12/06 21:26:05 joerg Exp $ SHA1 (smaSHeM-0.4.tar.gz) = 2eb22f2db02bd362a350d2d624ac431b1cfadc90 RMD160 (smaSHeM-0.4.tar.gz) = e968da7aaba5dfdd4050804f88ae08bf840345ab Size (smaSHeM-0.4.tar.gz) = 215081 bytes +SHA1 (patch-src_smaSHeM.cpp) = cb5ace9c3f92819ba10fd1fcbdfad7996862eb37 diff --git a/security/smaSHeM/patches/patch-src_smaSHeM.cpp b/security/smaSHeM/patches/patch-src_smaSHeM.cpp new file mode 100644 index 00000000000..35b9486de2b --- /dev/null +++ b/security/smaSHeM/patches/patch-src_smaSHeM.cpp @@ -0,0 +1,71 @@ +$NetBSD: patch-src_smaSHeM.cpp,v 1.1 2013/12/06 21:26:05 joerg Exp $ + +--- src/smaSHeM.cpp.orig 2013-11-29 12:09:30.000000000 +0000 ++++ src/smaSHeM.cpp +@@ -22,7 +22,7 @@ Foundation, Inc., 51 Franklin St, Fifth + + #include "smaSHeM.h" + +-void usage(char *commandname) { ++void usage(const char *commandname) { + if (commandname != (char *) NULL) { + fprintf(stderr, "usage: %s -v | -i <shmemid> -l <shmemlength> <-@ <patchoffset> -s <patchstring> | -d [-p | -c | -P | -j -x <xstart> -X <endx> -y <starty> -Y <yend>]>\n", commandname); + } else { +@@ -31,7 +31,7 @@ void usage(char *commandname) { + exit(EXIT_FAILURE); + } + +-void error(char *commandname, char *errorstring) { ++void error(const char *commandname, const char *errorstring) { + if (errno) { + if (errorstring != (char *) NULL) { + perror(errorstring); +@@ -164,7 +164,7 @@ int main(int argc, char **argv) { + if ((shmembuffer = (void *) shmat(shmemid, (void *) NULL, SHM_RND)) != (void *) -1) { + if (patchstring != (char *) NULL) { + for (patchcounter = 0; patchcounter < strlen(patchstring); patchcounter ++) { +- *((char *) (shmembuffer + patchoffset + patchcounter)) = *(patchstring + patchcounter); ++ *((char *)shmembuffer + patchoffset + patchcounter) = *(patchstring + patchcounter); + } + } + shmdt(shmembuffer); +@@ -181,32 +181,32 @@ int main(int argc, char **argv) { + if (jpegflag != TRUE) { + for (displaycounter = 0; displaycounter < shmemlength; displaycounter ++) { + if (perlflag == TRUE) { +- printf("\\x%02x", (unsigned char) *((char *) (shmembuffer + displaycounter))); ++ printf("\\x%02x", (unsigned char) *((char *)shmembuffer + displaycounter)); + } else { + if (cflag == TRUE) { +- printf("0x%02x", (unsigned char) *((char *) (shmembuffer + displaycounter))); ++ printf("0x%02x", (unsigned char) *((char *)shmembuffer + displaycounter)); + if ((displaycounter + 1) < shmemlength) { + printf(","); + } + } else { + if (prettyflag == TRUE) { + if ((displaycounter % PRETTYLINELENGTH) == 0) { +- printf("0x%08x\t", shmembuffer + displaycounter); ++ printf("0x%08x\t", (char *)shmembuffer + displaycounter); + } + if ((displaycounter % PRETTYLINELENGTH) > 0) { + printf(" "); + } +- if (isalnum((unsigned char) *((char *) (shmembuffer + displaycounter)))) { +- prettybuffer[displaycounter % PRETTYLINELENGTH] = (unsigned char) *((char *) (shmembuffer + displaycounter)); ++ if (isalnum((unsigned char) *((char *)shmembuffer + displaycounter))) { ++ prettybuffer[displaycounter % PRETTYLINELENGTH] = (unsigned char) *((char *)shmembuffer + displaycounter); + } else { + prettybuffer[displaycounter % PRETTYLINELENGTH] = (unsigned char) '.'; + } +- printf("%02x", (unsigned char) *((char *) (shmembuffer + displaycounter))); ++ printf("%02x", (unsigned char) *((char *)shmembuffer + displaycounter)); + if ((displaycounter % PRETTYLINELENGTH) == (PRETTYLINELENGTH - 1)) { + printf("\t%s\n", prettybuffer); + } + } else { +- printf("%c", (unsigned char) *((char *) (shmembuffer + displaycounter))); ++ printf("%c", (unsigned char) *((char *)shmembuffer + displaycounter)); + } + } + } |