diff options
| author | 2011-05-21 13:21:43 -0400 | |
|---|---|---|
| committer | 2011-05-21 13:21:43 -0400 | |
| commit | 976fd4b1b99d06022aaae9086de132da80b24099 (patch) | |
| tree | fcf309fc11e8f4591e81fcfd5774b179759e29f6 | |
| parent | Oops. (diff) | |
| download | BruteZip-976fd4b1b99d06022aaae9086de132da80b24099.tar.xz BruteZip-976fd4b1b99d06022aaae9086de132da80b24099.zip | |
Die on big endian.
| -rw-r--r-- | read.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -25,6 +25,15 @@ typedef struct { int main(int argc, char *argv[]) { + union { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + if (u.c[sizeof(long int) - 1] == 1) { + printf("This program only runs on little endian archs, because I'm lazy. Sorry.\n"); + return -2; + } if (argc != 2) return -1; FILE *fh = fopen(argv[1], "rb"); |
