Check the return value of strtok
.
In your code here
locTok = strtok(NULL, ".."); posL[pCount].stop = atoi(locTok); //ERROR IS SHOWN HERE
strtok
is returning a NULL pointer and according to documentation,
A null pointer is returned if there are no tokens left to retrieve.
which matches my original guess that because the address code is 0x0
there’s a NULL pointer deference somewhere.
Obviously, the following call to atoi
is expecting a non-NULL pointer and crashes.
Related Posts:
- Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)
- Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)
- Xcode – Warning: Implicit declaration of function is invalid in C99
- How to update Xcode from command line
- malloc for struct and pointer in C
- UIStackView before iOS 9.0
- How do malloc() and free() work?
- Valgrind complains with “Invalid write of size 8”
- What does this GCC error “… relocation truncated to fit…” mean?
- Xcode 10 Error: Multiple commands produce
- malloc(): memory corruption
- C: pointer to array of pointers to structures (allocation/deallocation issues)
- ld: warning: directory not found for option’
- Code signing is required for product type ‘Application’ in SDK ‘iOS 10.0’ – StickerPackExtension requires a development team error
- Failed to create provisioning profile
- Dynamic vs static array in c
- How to download Xcode DMG or XIP file?
- How can I create a dynamically sized array of structs?
- How to format code in Xcode?
- The difference between n++ and ++n at the end of a while loop? (ANSI C)
- How many spaces for tab character(\t)?
- Working on code to calculate cosine with factorial sum
- What is the effect of extern “C” in C++?
- What exactly is the difference between “pass by reference” in C and in C++?
- What does “collect2: error: ld returned 1 exit status” mean?
- Floating point exception (core dumped)
- Correct format specifier for double in printf
- Compiler Error “void value not ignored as it ought to be” in C programming [duplicate]
- Scanf/Printf double variable C
- How to convert a string to integer in C?
- What does pss mean in /proc/pid/smaps
- What is the behavior of integer division?
- max value of integer
- Convert an int to ASCII character
- How can I explicitly free memory in Python?
- Error “initializer element is not constant” when trying to initialize variable with const
- Cannot assign requested address – possible causes?
- need help understanding the movzbl call in this function
- How to extract C source code from .so file?
- What is the difference between read and pread in unix?
- What does “control reaches end of non-void function” mean?
- connect Error: “No route to host”
- C error: undefined reference to function, but it IS defined
- What is the printf format specifier for bool?
- C dynamically growing array
- How to printf “unsigned long” in C?
- Why do I get an assertion failure?
- Difference between int32, int, int32_t, int8 and int8_t
- Which Python memory profiler is recommended? [closed]
- lvalue required as left operand of assignment
- how to convert negative hexadecimal to decimal
- Why am I getting “undefined reference to sqrt” error even though I inclu de math.h header?
- How to initialize a struct in accordance with C programming language standards
- expression must have integral type
- Why is %c used in C?
- How do you pass a function as a parameter in C?
- C free(): invalid pointer
- Eclipse C++ : “Program “g++” not found in PATH”
- How can I use an array of function pointers?
- When and why to use malloc?
- C compile error: Id returned 1 exit status
- How do I concatenate const/literal strings in C?
- Efficient way to find task_struct by pid
- Why am I getting this memory access error ‘double free or corruption’?
- size of struct in C
- Command CompileSwift failed with a nonzero exit code in Xcode 10
- Where is the C auto keyword used?
- How can one print a size_t variable portably using the printf family?
- How to make sense of modulo in c
- “No such file or directory” error in CodeBlocks
- What is the C equivalent to the C++ cin statement?
- Makefile:1: *** missing separator. Stop
- Invalid type argument of unary ‘*’ (have ‘int’) Error in C
- Why do I get “cast from pointer to integer of different size” error?
- xorl %eax – Instruction set architecture in IA-32
- Assembly x86 – “leave” Instruction
- Can I define a function inside a C structure?
- Trim a string in C [duplicate]
- Casting a pointer to an int
- How to repeat a char using printf?
- C Unknown type name ‘my_structure’
- Source file not compiled Dev C++
- PTHREAD_MUTEX_INITIALIZER vs pthread_mutex_init ( &mutex, param)
- How to concatenate string and int in C?
- execvp: bad address error
- How do you format an unsigned long long int using printf?
- error : storage class specified for parameter
- Dereference void pointer
- Failed to launch macOS app built in Xcode
- Use of flag in c?
- Reading float using scanf in c
- “-bash: gcc: command not found” using cygwin when compiling c?
- What do \t and \b do?
- write() to stdout and printf output not interleaved?
- Storyboard warning: prototype table cells must have reuse identifiers
- Download Xcode simulator directly
- Level vs Edge Trigger Network Event Mechanisms
- How to convert integers to characters in C?
- variably modified array at file scope in C
- How to use random() in C [duplicate]