buffer = silc_calloc(filelen + 1, sizeof(char));
if ((silc_file_read(fd, buffer, filelen)) == -1) {
- memset(buffer, 0, sizeof(buffer));
+ memset(buffer, 0, filelen + 1);
silc_file_close(fd);
SILC_LOG_ERROR(("Cannot read from file %s: %s", filename,
strerror(errno)));
int ret;
struct stat stats;
-#ifndef SILC_WIN32
+#ifdef SILC_WIN32
+ ret = stat(filename, &stats);
+#endif /* SILC_WIN32 */
+#ifdef SILC_UNIX
ret = lstat(filename, &stats);
-#else
+#endif /* SILC_UNIX */
+#ifdef SILC_SYMBIAN
ret = stat(filename, &stats);
-#endif
+#endif /* SILC_SYMBIAN */
if (ret < 0)
return 0;