Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Clibrary
I downloaded libyahoo2 and I'm trying to login but get a segmentation fault when the yahoo_login() function is called. Here's the code I'm using:
 
#include <stdio.h>
#include <liblyahoo2/yahoo2.h>
#include <libyahoo2/yahoo2_callbacks.h>

int main(int argc, char **argv)
{
    int id;
 
    id = yahoo_init(argv[1], argv[2]);
    yahoo_login(id, 0);  //this is where I get the seg fault
    yahoo_close(id);
 
    return 0;
}
 
I've been all over google and haven't found a solution
Posted 12-Oct-12 16:09pm
Comments
Chuck O'Toole at 12-Oct-12 22:38pm
   
What are the command line arguments? Are you sure there are two of them, "Username" and "password". A null for either will cause a crash, you should check in the code for either argv[1] or argv[2] being null before using them to protect against bad command line invocation.
doughyi8u at 12-Oct-12 22:48pm
   
yes, there's only two args to yahoo_init(username, password). I've even tried using a call like: yahoo_init("username", "password");
Andrewpeter at 12-Oct-12 22:38pm
   
What is prototype of yahoo_login() function?
doughyi8u at 12-Oct-12 22:54pm
   
yahoo_login(int id, ENUMERATION_TYPE); where id is the return value of init_yahoo("username", "password") and ENUMERATION TYPE is a value called from enum yahoo_status. 0 is AVAILABLE and should work according to http://libyahoo2.sourceforge.net/README
Richard MacCutchan at 13-Oct-12 3:19am
   
What is the value of id on return from yahoo_init()?
doughyi8u at 13-Oct-12 7:35am
   
1
Richard MacCutchan at 13-Oct-12 11:48am
   
I think you forgot to code the callback routines. You need to check the documentation.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 375
1 Abhinav S 333
2 OriginalGriff 330
3 sanket saxena 305
4 CPallini 205
0 Sergey Alexandrovich Kryukov 8,497
1 OriginalGriff 4,850
2 Peter Leow 3,839
3 Maciej Los 3,515
4 Er. Puneet Goel 3,107


Advertise | Privacy | Mobile
Web02 | 2.8.140415.2 | Last Updated 12 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid