mirror of
https://github.com/EnergyMech/energymech.git
synced 2025-12-29 16:14:43 +00:00
Initial Import
This commit is contained in:
19
config/unaligned.c
Normal file
19
config/unaligned.c
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
int buserror(char *data)
|
||||
{
|
||||
int *x;
|
||||
x = (int*)(data+1);
|
||||
return(*x);
|
||||
}
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
char busdata[6];
|
||||
int x;
|
||||
strcpy(busdata,"Xyes\n");
|
||||
x = buserror(busdata);
|
||||
write(1,&x,4);
|
||||
return(0);
|
||||
}
|
||||
Reference in New Issue
Block a user