summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2012-06-05 18:05:41 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2012-06-05 18:05:41 -0700
commitc7af632206a794407dd5ee52fc0b18b2478668b4 (patch)
treec2dc83a80b0253b441126ee42cd499334e0bb370
parente7d3ef457bff9d14b308b88d88f7942eca1cabb8 (diff)
unifdef __UNIXOS2__
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--showrgb.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/showrgb.c b/showrgb.c
index e2d5a0f..31936ea 100644
--- a/showrgb.c
+++ b/showrgb.c
@@ -124,16 +124,9 @@ dumprgb (const char *filename)
int lineno = 0;
int red, green, blue;
-#ifdef __UNIXOS2__
- char *root = (char*)getenv("X11ROOT");
- sprintf(line,"%s%s.txt",root,filename);
- path = (char *)malloc(strlen(line) + 1);
- strcpy(path,line);
-#else
path = (char *)malloc(strlen(filename) + 5);
strcpy(path, filename);
strcat(path, ".txt");
-#endif
if (!(rgb = fopen(path, "r"))) {
fprintf (stderr, "%s: unable to open rgb database \"%s\"\n",
@@ -144,11 +137,7 @@ dumprgb (const char *filename)
while(fgets(line, sizeof(line), rgb)) {
lineno++;
-#ifndef __UNIXOS2__
if (sscanf(line, "%d %d %d %[^\n]\n", &red, &green, &blue, name) == 4) {
-#else
- if (sscanf(line, "%d %d %d %[^\n\r]\n", &red, &green, &blue, name) == 4) {
-#endif
if (red >= 0 && red <= 0xff &&
green >= 0 && green <= 0xff &&
blue >= 0 && blue <= 0xff) {