[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
problem with hexlify-buffer
From: |
ian martins |
Subject: |
problem with hexlify-buffer |
Date: |
Wed, 17 Apr 2002 12:11:19 -0800 |
I'm using emacs-21.2.1 on win2k, compiled with nmake. (I tried some earlier
versions also, and got the same result)
when I look at binary file with only an integer (32 bit) value of 60 or
greater in it using emacs hexl-mode, it says:
00000000: 81a0 0000 00 .....
it should say:
00000000: a00 0000 .....
I've viewed the file with a different hex viewer and also xemacs and they
both worked. for all values greater than 60 emacs sticks a hex "81" in front
of the correct bytes.
in case it saves someone time, here is some c code that will create two
files, one containing an integer value "59" (which emacs reads correctly)
the other contains an integer 60 (which doesn't work for me)
#include <stdio.h>
void main()
{
FILE *fout1, *fout2;
int n1 = 159;
int n2 = 160;
int *p1 = &n1;
int *p2 = &n2;
fout1 = fopen("f159.good","wb");
fwrite(p1, sizeof(int), 1, fout1);
fout2 = fopen("f160.bad","wb");
fwrite(p2, sizeof(int), 1, fout2);
fclose(fout1);
fclose(fout2);
}
please ask if I've left out needed info.
Ian Martins
ianxm@hotmail.com
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
- problem with hexlify-buffer,
ian martins <=