diff -Nur /home/ignaz/Downloads/sources/cdi2nero/buffer.c ./buffer.c
--- /home/ignaz/Downloads/sources/cdi2nero/buffer.c	2001-03-15 12:45:26.000000000 +0100
+++ ./buffer.c	2008-04-07 22:58:03.000000000 +0200
@@ -1,5 +1,6 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include "buffer.h"
 
 
diff -Nur /home/ignaz/Downloads/sources/cdi2nero/cdi2nero.c ./cdi2nero.c
--- /home/ignaz/Downloads/sources/cdi2nero/cdi2nero.c	2002-06-08 01:31:36.000000000 +0200
+++ ./cdi2nero.c	2008-04-19 16:46:05.000000000 +0200
@@ -10,6 +10,12 @@
 #include "buffer.h"
 #include "cdi.h"
 
+// Definitions for POSIX compatible systems
+
+#ifdef __unix__
+#include "limits.h"
+#endif
+
 // Global variables
 
 char *global_read_buffer_ptr;
@@ -449,9 +455,12 @@
         return CANCELLED;
 
 #else
+     char *p;
      printf("\nPlease enter name of CDI image (return to exit): ");
-     gets(string);
-     if (strlen(string) == 0) return CANCELLED;
+     fgets(string, MAX_PATH, stdin);
+     if (strlen(string) == 1) return CANCELLED;
+     if ((p = strchr(string, '\n')) != NULL)
+       *p = '\0';
 #endif
 
      return 0; // OK
@@ -494,13 +503,17 @@
      else
         return CANCELLED;
 
+     return ofn.nFilterIndex;  // 1=DAO, 2=TAO
 #else
+     char *p;
      printf("\nPlease enter name of NRG image (return to exit): ");
-     gets(string);
-     if (strlen(string) == 0) return CANCELLED;
+     fgets(string, MAX_PATH, stdin);
+     if (strlen(string) == 1) return CANCELLED;
+     if ((p = strchr(string, '\n')) != NULL)
+       *p = '\0';
+     printf("\nEnter \"1\" for a DAO or \"2\" for a TAO image: ");
+     return getchar();
 #endif
-
-     return ofn.nFilterIndex;  // 1=DAO, 2=TAO
 }
 
 
@@ -552,7 +565,7 @@
 
 src = data;
 
-#ifdef BIG_ENDIAN
+#ifdef USE_BIG_ENDIAN
       for (i=0; i < size; i++)
           buffer[*index+i] = src[i];
 #else
diff -Nur /home/ignaz/Downloads/sources/cdi2nero/common.c ./common.c
--- /home/ignaz/Downloads/sources/cdi2nero/common.c	2002-04-09 02:44:12.000000000 +0200
+++ ./common.c	2008-04-19 16:42:19.000000000 +0200
@@ -15,7 +15,7 @@
 
      tmp = buf;
 
-#ifdef BIG_ENDIAN
+#ifdef USE_BIG_ENDIAN
      for (i = length; i > 0; i--)
          if (!fread(&(tmp[i-1]), 1, 1, fsource)) return 0; // error
 #else
@@ -33,7 +33,7 @@
 
      tmp = buf;
 
-#ifdef BIG_ENDIAN
+#ifdef USE_BIG_ENDIAN
      for (i = 0; i < length; i++)
          if (!fread(&(tmp[i]), 1, 1, fsource)) return 0; // error
 #else
@@ -51,7 +51,7 @@
 
      tmp = buf;
 
-#ifdef BIG_ENDIAN
+#ifdef USE_BIG_ENDIAN
      for (i = length; i > 0; i--)
          if (!fwrite(&(tmp[i-1]), 1, 1, fdest)) return 0; // error
 #else
@@ -69,7 +69,7 @@
 
      tmp = buf;
 
-#ifdef BIG_ENDIAN
+#ifdef USE_BIG_ENDIAN
      for (i = 0; i < length; i++)
          if (!fwrite(&(tmp[i]), 1, 1, fdest)) return 0; // error
 #else
@@ -115,7 +115,8 @@
     MessageBoxA(hWnd, errmessage, NULL, MB_OK | MB_ICONERROR);
     ExitProcess(0);
 #else
-    printf(errmessage);
+    printf(errmessage);
+    printf("\n");
     exit(EXIT_FAILURE);
 #endif
 
diff -Nur /home/ignaz/Downloads/sources/cdi2nero/common.h ./common.h
--- /home/ignaz/Downloads/sources/cdi2nero/common.h	2002-04-09 02:44:12.000000000 +0200
+++ ./common.h	2008-04-13 20:39:34.000000000 +0200
@@ -9,11 +9,23 @@
 #define ERR_READIMAGE 0x03
 #define ERR_SAVEIMAGE 0x04
 #define ERR_PATH      0x05
-
+
+/* Definitions for POSIX compatible systems */
+
+#ifdef __unix__
+#define MAX_PATH                PATH_MAX
+#define strincmp(s1, s2, n)     strncasecmp(s1, s2, n)
+#define stricmp(s1, s2)         strcasecmp(s1, s2)
+#endif
 
 /* For Debug only! */
 
-// #define DEBUG_CDI
+// #define DEBUG_CDI
+
+/* Compile options */
+
+// Uncomment this flag if compiling the software on a big endian machine
+//#define USE_BIG_ENDIAN 1
 
 
 
diff -Nur /home/ignaz/Downloads/sources/cdi2nero/Makefile ./Makefile
--- /home/ignaz/Downloads/sources/cdi2nero/Makefile	1970-01-01 01:00:00.000000000 +0100
+++ ./Makefile	2008-04-13 18:02:24.000000000 +0200
@@ -0,0 +1,33 @@
+# Project: CDI2nero
+# Makefile originally created by Dev-C++ 4.9.3.0
+
+CC   = gcc
+WINDRES =
+RES  = 
+OBJ  = cdi2nero.o buffer.o cdi.o common.o $(RES)
+LIBS = 
+INCS =
+BIN  = cdi2nero
+CFLAGS = $(INCS) 
+
+.PHONY: clean
+
+all: cdi2nero
+
+clean:
+	rm -f $(OBJ) $(BIN)
+
+$(BIN): $(OBJ)
+	$(CC) $(OBJ) -o $(BIN) $(RES) $(LIBS) $(CFLAGS)
+
+cdi2nero.o: cdi2nero.c 
+	$(CC) -c cdi2nero.c -o cdi2nero.o $(CFLAGS)
+
+buffer.o: buffer.c 
+	$(CC) -c buffer.c -o buffer.o $(CFLAGS)
+
+cdi.o: cdi.c 
+	$(CC) -c cdi.c -o cdi.o $(CFLAGS)
+
+common.o: common.c 
+	$(CC) -c common.c -o common.o $(CFLAGS)
diff -Nur /home/ignaz/Downloads/sources/cdi2nero/Makefile.cdi2nero.posix ./Makefile.cdi2nero.posix
--- /home/ignaz/Downloads/sources/cdi2nero/Makefile.cdi2nero.posix	1970-01-01 01:00:00.000000000 +0100
+++ ./Makefile.cdi2nero.posix	2008-04-13 18:02:24.000000000 +0200
@@ -0,0 +1,33 @@
+# Project: CDI2nero
+# Makefile originally created by Dev-C++ 4.9.3.0
+
+CC   = gcc
+WINDRES =
+RES  = 
+OBJ  = cdi2nero.o buffer.o cdi.o common.o $(RES)
+LIBS = 
+INCS =
+BIN  = cdi2nero
+CFLAGS = $(INCS) 
+
+.PHONY: clean
+
+all: cdi2nero
+
+clean:
+	rm -f $(OBJ) $(BIN)
+
+$(BIN): $(OBJ)
+	$(CC) $(OBJ) -o $(BIN) $(RES) $(LIBS) $(CFLAGS)
+
+cdi2nero.o: cdi2nero.c 
+	$(CC) -c cdi2nero.c -o cdi2nero.o $(CFLAGS)
+
+buffer.o: buffer.c 
+	$(CC) -c buffer.c -o buffer.o $(CFLAGS)
+
+cdi.o: cdi.c 
+	$(CC) -c cdi.c -o cdi.o $(CFLAGS)
+
+common.o: common.c 
+	$(CC) -c common.c -o common.o $(CFLAGS)
