Forum


Notice to all users

We are migrating towards a new forum system located at community.teamspeak.com, as such this forum will become read-only on January 29, 2020

Results 1 to 3 of 3
  1. #1
    Join Date
    January 2012
    Posts
    8

    [HELP]strncmp problem

    Hi all, its again me, this time i have a problem with strncmp.
    When i tri to compare 2 string it work fine but when i try to compare a string with a link it doent wok, any solution?

    This is my code.
    Code:
    ts3plugin_onTextMessageEvent(uint64 serverConnectionHandlerID, anyID targetMode, anyID toID, anyID fromID, const char* fromName, const char* fromUniqueIdentifier, const char* message, int ffIgnored) {
    
    if( strncmp( message, "http", 4 ) == 0 )
    {
          //do something
    }
    }
    When someone send a link the compare doesnt work.

  2. #2
    Join Date
    January 2010
    Location
    Germany
    Posts
    91
    i think teamspeak add [URL ][/URL ] (without the spaces) tags automatically, so the string doesn't actually start with "http".

  3. #3
    Join Date
    July 2006
    Posts
    1,600
    A additional note: if you strcmp by a fixed string you do not need the n-version of strcmp in general

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Serveredit problem, and Admin user problem.
    By 0wn3r in forum Linux / FreeBSD
    Replies: 1
    Last Post: December 23rd, 2018, 01:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •