C program to get text between 2 substrings of the main string

#include <stdio.h>
#include <string.h>


int get_string_between_two_substrings(const char *str)
{

    const char *PATTERN1 = "LOCATION: ";
    const char *PATTERN2 = ".xml";

    char target[100];
    char *start, *end;

    memset(target, '\0', sizeof(target));

    /* start would point to the beginning of the substring in the main string.  */
    if ( start = strstr( str, PATTERN1 ) )
    {
    /* move the start pointer to string length(PATTERN) times ahead.
         * Now, start points to the beginning of the text be searched.
         */
        start += strlen( PATTERN1 );
 
        /* Now, search for pattern 2. end points to the beginning of PATTERN2  */
        if ( end = strstr( start, PATTERN2 ) )
        {
        /* Now, copy the text between PATTERN1 and PATTERN2 */  
            memcpy( target, start, end - start );
            target[end - start] = '\0';
        }
    }

    if ( target ) printf( "%s\n", target );

    return 0;
}


void main(void)
{

    const char *s = "LOCATION: http://192.168.1.197:8008/ssdp/device-desc.xml";

    get_string_between_two_substrings(s);

    return;          
}

Python code for Multi-threading and using message queues to transmit messages between tasks

import threading
import os
from queue import Queue

def task1(in_q):
#while True:
        print("Task 1 assigned to thread: {}".format(threading.current_thread().name))
        print("ID of process running task 1: {}".format(os.getpid()))

def task2(out_q):
#    while True:
        print("Task 2 assigned to thread: {}".format(threading.current_thread().name))
        print("ID of process running task 2: {}".format(os.getpid()))
        print('message sent to task 3: I am neelkanth reddy... sending message')
        out_q.put('I am neelkanth reddy... sending message')

def task3(in_q):
#    while True:
        print("Task 3 assigned to thread: {}".format(threading.current_thread().name))
        print("ID of process running task 3: {}".format(os.getpid()))
        h = in_q.get()
        print('message received from task 2: '  + h)
        in_q.task_done()

if __name__ == "__main__":
   # print ID of current process
   print("ID of process running main program: {}".format(os.getpid()))

   # print name of main thread
   print("Main thread name: {}".format(threading.main_thread().name))

   q = Queue()


   # creating threads
   t1 = threading.Thread(target=task1, args=(q,), name='t1')
   t2 = threading.Thread(target=task2, args=(q,), name='t2')
   t3 = threading.Thread(target=task3, args=(q,), name='t3')


   # starting threads
   t1.start()
   t2.start()
   t3.start()

# wait until all threads finish
   t1.join()
   t2.join()
   t3.join()