Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 403
    • Issues 403
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Issues
  • #2149
Closed
Open
Created Dec 11, 2006 by Markus Weigel@mwgGuest

segmentation fault when reading from streams

Bugzilla Link 335
Created on Dec 11, 2006 18:06
Resolution FIXED
Resolved on Dec 12, 2006 10:46
Version svn
OS Linux
Architecture PC

Extended Description

I encountered a segmentation fault when trying to read a string from a text file
and sending it to StdIO. I am not sure wether this is my mistake (am I required
to allocate memory for strings?) or the compiler's.
Try this example:
use StdIO: all;
/* input example:
filename:	2DBild1.dat 
dimension:	2 
omega1:	64
omega2:	64
m1:	64
m2:	64
representation format: double
*/
int main() {
  err, stream = fopen("text1.txt","r");
  /* Try to read "filename:" */
  s = fscans(stream,20);
  printf(s);
  fclose(stream);
  return(0);
}
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking