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?
- How big can a 64 bit unsigned integer be?
- Is “delete this” allowed in C++?
- The difference between n++ and ++n at the end of a while loop? (ANSI C)
- What is a segmentation fault?
- How many spaces for tab character(\t)?
- Implementing Taylor Series for sine and cosine in C
- Working on code to calculate cosine with factorial sum
- How to use execvp()
- How to use execvp() to execute a command
- How does strtok() split the string into tokens in C?
- What and where are the stack and heap?
- warning: implicit declaration of function
- warning: implicit declaration of function
- What is *(uint32_t*)?
- What does (~0L) mean?
- pthread_join() and pthread_exit()
- What is size_t in C?
- What is the difference between float and double?
- what is Segmentation fault (core dumped)? [duplicate]
- What causes a segmentation fault (core dump) to occur in C?
- uint8_t vs unsigned char
- How to use symbols of extended ASCII table in C?
- Two questions about basic C programs
- What is the difference between ++i and i++?
- Using boolean values in C
- What does “collect2: error: ld returned 1 exit status” mean?
- How to convert an int to string in C?
- typedef struct vs struct definitions [duplicate]
- How to print in C
- What is the effect of extern “C” in C++?
- Why should we typedef a struct so often in C?
- Why are #ifndef and #define used in C++ header files?
- Arrow operator (->) usage in C
- strdup() – what does it do in C?
- strdup() – what does it do in C?
- What is a string of hexadecimal digits?
- Why should we typedef a struct so often in C?
- What exactly is the difference between “pass by reference” in C and in C++?
- What is the difference between ++i and i++?
- What can be the reasons of connection refused errors?
- What does “collect2: error: ld returned 1 exit status” mean?
- How to convert an int to string in C?
- typedef struct vs struct definitions [duplicate]
- What is newline character — ‘\n’
- When to use extern “C” in simple words? [duplicate]
- Floating point exception( core dump
- Why does ENOENT mean “No such file or directory”?
- What does the question mark character (‘?’) mean?
- Cannot figure out how to use getchar(); in C
- Floating point exception (core dumped)
- Undefined reference to pthread_create in Linux
- what is the difference between uint16_t and unsigned short int incase of 64 bit processor?
- makefile:4: *** missing separator. Stop
- Stack smashing detected
- Why am I getting “void value not ignored as it ought to be”?
- Correct format specifier for double in printf
- Compiler Error “void value not ignored as it ought to be” in C programming [duplicate]
- Stack smashing detected
- How do I determine the size of my array in C?
- Why am I getting “void value not ignored as it ought to be”?
- Mutex example / tutorial? [closed]
- Scanf/Printf double variable C
- Pointer Arithmetic
- dereferencing pointer to incomplete type
- 1 = false and 0 = true?
- c stack smashing detected
- What does “dereferencing” a pointer mean?
- What are the -Xms and -Xmx parameters when starting JVM?
- Openssl : error “self signed certificate in certificate chain”
- How to convert a string to integer in C?
- What is the difference between C and embedded C?
- What is an unsigned char?
- What does pss mean in /proc/pid/smaps
- What does “dereferencing” a pointer mean?
- Get a substring of a char* [duplicate]
- C Linking Error: undefined reference to ‘main’
- char *array and char array[]
- How do I create an array of strings in C?
- Undefined reference to pthread_create
- What is the behavior of integer division?
- Convert char to int in C and C++