URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 883 |
Rev 897 |
Line 102... |
Line 102... |
r = (char *)malloc (strlen (s) + 1);
|
r = (char *)malloc (strlen (s) + 1);
|
strcpy (r, s);
|
strcpy (r, s);
|
return (r);
|
return (r);
|
}
|
}
|
|
|
|
/* This function is very similar to strncpy, except it null terminates the string */
|
|
char *strstrip (char *dst, const char *src, int n)
|
|
{
|
|
strncpy (dst, src, n);
|
|
*(dst + n) = '\0';
|
|
return dst;
|
|
}
|
|
|
/* Parses string line and puts up to maxparam parameters into argv[]; number of parameters is returned */
|
/* Parses string line and puts up to maxparam parameters into argv[]; number of parameters is returned */
|
int tokenize_line (char *str, char *argv[], int maxparam)
|
int tokenize_line (char *str, char *argv[], int maxparam)
|
{
|
{
|
int i, param = 0;
|
int i, param = 0;
|
str = stripwhite (str);
|
str = stripwhite (str);
|
Line 533... |
Line 541... |
exit(1);
|
exit(1);
|
}
|
}
|
}
|
}
|
else if(ELF_LONG_H(elf_spnt->sh_type) == SHT_SYMTAB) {
|
else if(ELF_LONG_H(elf_spnt->sh_type) == SHT_SYMTAB) {
|
|
|
if((sym_tbl = (char *)malloc(ELF_LONG_H(elf_spnt->sh_size))) == NULL) {
|
if((sym_tbl = (struct elf32_sym *)malloc(ELF_LONG_H(elf_spnt->sh_size))) == NULL) {
|
perror("readfile_elf");
|
perror("readfile_elf");
|
exit(1);
|
exit(1);
|
}
|
}
|
|
|
if (fseek(inputfs, ELF_LONG_H(elf_spnt->sh_offset), SEEK_SET) != 0) {
|
if (fseek(inputfs, ELF_LONG_H(elf_spnt->sh_offset), SEEK_SET) != 0) {
|
© copyright 1999-2025
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.