functionSource
stringlengths
20
97.4k
CWE-119
bool
2 classes
CWE-120
bool
2 classes
CWE-469
bool
2 classes
CWE-476
bool
2 classes
CWE-other
bool
2 classes
combine
int64
0
1
onUserChanged( LastFmUserSettings& user ) { ui.hello->setText( tr("Hello %1,").arg( user.username() ) ); ui.combo->setCurrentIndex( CurrentUserSettings().value( "RestStateWidgetComboIndex", 0 ).toInt() ); ui.label1->setText( tr( "Last.fm keeps a record of what you listen to and adds it to your <a href='%1'...
false
false
false
false
false
0
m_Execute(Object *in) { char *action, *tmpaction; int i, count; char buf[20]; if (!in[0]) action = "end"; else { if (!DXExtractString(in[0],&tmpaction)) { DXSetError(ERROR_BAD_PARAMETER,"action must be a string"); goto error; } action = DXAllocate(strlen(tmpaction)+1); ...
true
true
true
false
false
1
compiler_with(struct compiler *c, stmt_ty s, int pos) { basicblock *block, *finally; withitem_ty item = asdl_seq_GET(s->v.With.items, pos); assert(s->kind == With_kind); block = compiler_new_block(c); finally = compiler_new_block(c); if (!block || !finally) return 0; /* Evaluate E...
false
false
false
false
false
0
print_lnb(int i) { if (i < 0 || i >= ARRAY_SIZE(lnb)) return -1; printf("%s\n\t%s\n", lnb[i].alias, lnb[i].name); printf("\t%d to %d MHz", lnb[i].freqrange[0].low, lnb[i].freqrange[0].high); if (lnb[i].freqrange[1].low) printf(" and %d to %d MHz", lnb[i].freqrange[1].low, lnb[i].freqrange[1].h...
false
false
false
false
false
0
l3_1tr6_setup_ack(struct l3_process *pc, u_char pr, void *arg) { u_char *p; struct sk_buff *skb = arg; L3DelTimer(&pc->timer); p = skb->data; newl3state(pc, 2); if ((p = findie(p, skb->len, WE0_chanID, 0))) { if (p[1] != 1) { l3_1tr6_error(pc, "setup_ack wrong chanID len", skb); return; } if ((p[2] &...
false
false
false
false
false
0
vce_v1_0_set_wptr(struct radeon_device *rdev, struct radeon_ring *ring) { if (ring->idx == TN_RING_TYPE_VCE1_INDEX) WREG32(VCE_RB_WPTR, ring->wptr); else WREG32(VCE_RB_WPTR2, ring->wptr); }
false
false
false
false
false
0
test_collection_sync (Test *test, gconstpointer used) { GHashTable *properties; GError *error = NULL; gchar *path; properties = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify)g_variant_unref); g_hash_table_insert (properties, SECRET...
false
false
false
false
false
0
configtree(void *opt, char *cmd, char *arg1, char *arg2, int rc) { Tree **treex = (Tree **)opt; Hashindex item; Hashentry *own; char *name, *nameend, *t; if (rc == 0) { shortwarn(cmd, arg1, rc); return; } if (rc > 1) longwarn(cmd, arg1, arg2, rc); if (strchr(arg1, ',') != NULL) { if ((...
false
false
false
false
false
0
computeBVConst(const Expr& e) { DebugAssert(BVCONST == e.getKind(), "TheoryBitvector::computeBVConst:" "input must be a BITVECTOR CONST: " + e.toString()); if(*d_bv32Flag) { int c(0); for(int j=(int)getBVConstSize(e)-1; j>=0; j--) c = 2*c + getBVConstValue(e, j) ? 1 : 0; Rational d(c...
false
false
false
false
false
0
uploads_add_entry (EogPostasaPlugin *plugin, EogImage *image, GCancellable *cancellable) { GtkWindow *uploads_window; GdkPixbuf *thumbnail_pixbuf; GdkPixbuf *scaled_pixbuf; gchar *size, *uri; GtkTreeIter *iter; /* display the Uploads window got from the plugin */ uploads_window = uploads_get_dialog (plugin); g...
false
false
false
false
false
0
POKEY_Scanline(void) { #ifdef POKEY_UPDATE pokey_update(); #endif #ifdef VOL_ONLY_SOUND POKEYSND_UpdateVolOnly(); #endif #ifndef BASIC INPUT_Scanline(); /* Handle Amiga and ST mice. */ /* It's not a part of POKEY emulation, */ /* but it looks to be the best place to put it. */ #endif /* on nonpatched...
false
false
false
false
false
0
sizeHint() const { if ( m_dirty ) const_cast<ToolStripLayout*>( this )->calculateSize(); return m_sizeHint; }
false
false
false
false
false
0
normalize_color_encoding(color_encoding *encoding) { PNG_CONST double whiteY = encoding->red.Y + encoding->green.Y + encoding->blue.Y; if (whiteY != 1) { encoding->red.X /= whiteY; encoding->red.Y /= whiteY; encoding->red.Z /= whiteY; encoding->green.X /= whiteY; encoding->...
false
false
false
false
false
0
nv50_fb_vram_rblock(struct nvkm_ram *ram) { struct nvkm_subdev *subdev = &ram->fb->subdev; struct nvkm_device *device = subdev->device; int colbits, rowbitsa, rowbitsb, banks; u64 rowsize, predicted; u32 r0, r4, rt, rblock_size; r0 = nvkm_rd32(device, 0x100200); r4 = nvkm_rd32(device, 0x100204); rt = nvkm_rd32...
false
false
false
false
false
0
lockres_set_pending(struct ocfs2_lock_res *lockres) { assert_spin_locked(&lockres->l_lock); BUG_ON(!(lockres->l_flags & OCFS2_LOCK_BUSY)); lockres_or_flags(lockres, OCFS2_LOCK_PENDING); return lockres->l_pending_gen; }
false
false
false
false
false
0
needarg(char opt, int arg, int argc) { if (arg + 1 >= argc) { fprintf(stderr, "%s: option '%c' requires an argument!\n", ifstat_progname, opt); usage(EXIT_FAILURE); } }
false
false
false
false
false
0
send_string_len(Sock *sock,char *str,int len) { int val; if (len > 1023) { char *buf; buf = malloc(len+1); strncpy(buf,str,len); buf[len]='\0'; send_int(sock,len+1); val = swrite(sock, buf, len+1, NULL); free(buf); } else { static char buf[1024]; strncpy(buf, str, len); buf...
false
false
false
false
false
0
H5FDopen(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) { H5FD_t *ret_value=NULL; FUNC_ENTER_API(H5FDopen, NULL) /* Check arguments */ if(H5P_DEFAULT == fapl_id) fapl_id = H5P_FILE_ACCESS_DEFAULT; else if(TRUE!=H5P_isa_class(fapl_id,H5P_FILE_ACCESS)) ...
false
false
false
false
false
0
parseIf (tokenInfo *const token) { boolean read_next_token = TRUE; /* * If statements have two forms * if ( ... ) * one line; * * if ( ... ) * statement; * else * statement * * if ( ... ) { * multiple; * statements; * } * * * if ( ... ) { * ...
false
false
false
false
false
0
friends_dispatcher_do_sync (FriendsDispatcher* self, const gchar* action, guint* account_id, const gchar* argument, GError** error) { gchar* result = NULL; Block1Data* _data1_; GMainLoop* _tmp0_; gchar* _tmp1_; gchar* _tmp2_; gchar* account_id_str; guint* _tmp3_; DispatcherInterface* _tmp6_; const gchar* _tmp7...
false
false
false
false
false
0
LASIpAddPattern(NSErr_t *errp, int netmask, int pattern, LASIpTree_t **treetop) { int stopbit; /* Don't care after this point */ int curbit; /* current bit we're working on */ int curval; /* value of pattern[curbit] */ LASIpTree_t *curptr = NULL; /* p...
false
false
false
false
false
0
gwy_app_menu_data_popup_create(GtkAccelGroup *accel_group) { static struct { const gchar *label; gpointer callback; gpointer cbdata; guint key; GdkModifierType mods; } const menu_items[] = { { NULL, gwy_app_run_process_func, "mask_remov...
false
false
false
false
false
0
modeNumber(bool & cc,tcPDPtr parent, const tPDVector & children) const { int imode(-1); // must be two outgoing particles if(children.size()!=2){return imode;} // ids of the particles int id0(parent->id()); int id1(children[0]->id()); int id2(children[1]->id()); if(id0==idin_) { if((id1==...
false
false
false
false
false
0
ReadFloatArray(float *result, int numFloats) { if (numFloats <= 0) { return 1; } char dummy[4]; if (this->Fortran) { if (!this->IFile->read(dummy, 4)) { vtkErrorMacro("Read (fortran) failed."); return 0; } } if (!this->IFile->read((char*)result, sizeof(float)*...
false
false
false
false
false
0
read_filename(guint16 filename_length) { guint8 *filename = (guint8 *)g_malloc(sizeof(guint8) * (filename_length+1)); if (!read(filename, filename_length)) { g_free(filename); return NULL; } filename[filename_length] = '\0'; #ifdef DEBUG std::printf("Filename is %s\n", filename); #endif ...
false
false
false
false
false
0
mud_zmp_register_core_functions(MudTelnet *telnet) { gint count = 4; gint i; telnet->commands[0].name = g_strdup("zmp.ident"); telnet->commands[0].package = g_strdup("zmp."); telnet->commands[0].execute = ZMP_ident; telnet->commands[1].name = g_strdup("zmp.ping"); telnet->commands[1].packa...
false
false
false
false
false
0
PyvtkTimeStamp_Hash(PyObject *self) { PyVTKSpecialObject *obj = (PyVTKSpecialObject *)self; const vtkTimeStamp *op = static_cast<const vtkTimeStamp *>(obj->vtk_ptr); unsigned long mtime = *op; long h = (long)mtime; if (h != -1) { return h; } return -2; }
false
false
false
false
false
0
bnxt_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam *epause) { int rc = 0; struct bnxt *bp = netdev_priv(dev); struct bnxt_link_info *link_info = &bp->link_info; if (BNXT_VF(bp)) return rc; if (epause->autoneg) { link_info->autoneg |= BNXT_AUTONEG_FLOW_CTRL; link_info->req_flow_...
false
false
false
false
false
0
function_iterate_do_value (GnmEvalPos const *ep, FunctionIterateCB callback, gpointer closure, GnmValue const *value, gboolean strict, CellIterFlags iter_flags) { GnmValue *res = NULL; switch (value->type){ case VALUE_ERROR: if (strict) { res = value_dup ...
false
false
false
false
false
0
operator==(const Command& c) const { return _priority == c._priority && _command == _command; }
false
false
false
false
false
0
gen_insert_footer(int place) { static FILE *ip; if (ip != NULL) { rewind(ip); } else { ip = fopen(insert_footer, "r"); if (ip == NULL) die("cannot open include footer file '%s'.", insert_footer); } return sed(ip, place); }
false
false
false
false
false
0
DetectGoodFeatures(const Array3Df &image_and_gradients, FeatureList *features) { Array3Df gradient_matrix; ComputeGradientMatrix(image_and_gradients, WindowSize(), &gradient_matrix); Array3Df trackness; double trackness_mean; ComputeTrackness(gradient_matrix, &trackness, &...
false
false
false
false
false
0
gnc_tree_view_account_filter_by_view_info(Account* acct, gpointer data) { GNCAccountType acct_type; AccountViewInfo* avi = (AccountViewInfo*)data; g_return_val_if_fail(GNC_IS_ACCOUNT(acct), FALSE); acct_type = xaccAccountGetType(acct); if (!avi->include_type[acct_type]) return FALSE; if (!avi-...
false
false
false
false
false
0
runOnMachineFunction(MachineFunction &MF) { TRI = MF.getSubtarget().getRegisterInfo(); LIS = &getAnalysis<LiveIntervals>(); VRM = &getAnalysis<VirtRegMap>(); unsigned NumRegUnits = TRI->getNumRegUnits(); if (NumRegUnits != Matrix.size()) Queries.reset(new LiveIntervalUnion::Query[NumRegUnits]); Matrix....
false
false
false
false
false
0
DecodeAddrMode6Operand(MCInst &Inst, unsigned Val, uint64_t Address, const void *Decoder) { DecodeStatus S = MCDisassembler::Success; unsigned Rm = fieldFromInstruction(Val, 0, 4); unsigned align = fieldFromInstruction(Val, 4, 2); if (!Check(S, DecodeGPRRegisterClass(Inst, R...
false
false
false
false
false
0
enum_string_from_value(mca_base_var_enum_t *self, const int value, const char **string_value) { int count, ret, i; ret = self->get_count(self, &count); if (OPAL_SUCCESS != ret) { return ret; } for (i = 0 ; i < count ; ++i) { if (value == self->enum_values[i].value) { br...
false
false
false
false
false
0
validate_and_split_resource(const char *where, const char *arg, const char **left, unsigned *rnlenp, const char **right) { unsigned match_len; unsigned rnlen; const char *s = arg; static char me_dot[] = ME "."; static char me_star[] = ME "*"; /* Enforce "-3270." or "-3270*" or "*". */ if (!strncmp(s, me_do...
false
false
false
false
false
0
replay_node(SGFNode *node, int color_to_replay, float *replay_score, float *total_score) { SGFProperty *sgf_prop; /* iterate over properties of the node */ SGFProperty *move_prop = NULL; /* remember if we see a move property */ int color; /* color of move to be made at this node. */ int old_move; /* Th...
false
false
false
false
false
0
fromXml(const QDomElement &e) { if ( (e.attribute("xmlns") != "jabber:x:data") && (e.namespaceURI() != "jabber:x:data") ) return; QString type = e.attribute("type"); if ( type == "result" ) d->type = Data_Result; else if ( type == "submit" ) d->type = Data_Submit; else if ( type == "cancel" ) d->type = Da...
false
false
false
false
false
0
champlain_viewport_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { ChamplainViewport *viewport = CHAMPLAIN_VIEWPORT (object); ChamplainViewportPrivate *priv = viewport->priv; switch (prop_id) { case PROP_X_ORIGIN: champlain_viewport_set_origin (vi...
false
false
false
false
false
0
tm_workspace_find_scoped (const char *name, const char *scope, gint type, TMTagAttrType *attrs, gboolean partial, langType lang, gboolean global_search) { static GPtrArray *tags = NULL; if ((!theWorkspace)) return NULL; if (tags) g_ptr_array_set_size (tags, 0); else tags = g_ptr_array_new (); fill_find_...
false
false
false
false
false
0
cipher_chaos(const char *inblock, char *outblock, const int blksize, char *key, const int mode) { switch (mode) { case (DACT_MODE_CINIT+DACT_MODE_CDEC): case (DACT_MODE_CINIT+DACT_MODE_CENC): case DACT_MODE_CINIT: return(cipher_chaos_init(mode,key)); break; case DACT_MODE_CDEC: return(cipher_chaos_enc...
false
false
false
false
false
0
vmx_decache_cr3(struct kvm_vcpu *vcpu) { if (enable_ept && is_paging(vcpu)) vcpu->arch.cr3 = vmcs_readl(GUEST_CR3); __set_bit(VCPU_EXREG_CR3, (ulong *)&vcpu->arch.regs_avail); }
false
false
false
false
false
0
squelch_hide_item(object_type *o_ptr) { return (OPT(hide_squelchable) ? squelch_item_ok(o_ptr) : FALSE); }
false
false
false
false
false
0
PrecacheRadioSounds () { int i; char path[MAX_QPATH]; globalRadio[RADIO_CLICK].sndIndex = gi.soundindex(globalRadio[RADIO_CLICK].msg); globalRadio[RADIO_DEATH_MALE].sndIndex = gi.soundindex(globalRadio[RADIO_DEATH_MALE].msg); globalRadio[RADIO_DEATH_FEMALE].sndIndex = gi.soundindex(globalRadio[RADIO_DEATH_FEMALE]...
false
false
false
false
false
0
cmdif_go_bit(struct mtnic *mtnic) { struct mtnic_if_cmd_reg *hcr = mtnic->hcr; u32 status; int i; for (i = 0; i < TBIT_RETRIES; i++) { status = be32_to_cpu(readl(&hcr->status_go_opcode)); if ((status & MTNIC_BC_MASK(MTNIC_MASK_CMD_REG_T_BIT)) == (mtnic->cmd.tbit << MTNIC_BC_OFF(MTNIC_MASK_CMD_REG_T_BIT))...
false
false
false
false
false
0
SetField( int index, vtkAbstractArray *aa) { // Store the field name if ( this->Fields[index] ) { delete [] this->Fields[index]; this->Fields[index] = 0; } const char* name=aa->GetName(); if (name) { int len = static_cast<int>(strlen(name)); if (len > 0) { ...
false
false
false
false
false
0
cell_tile_style_new (GnmStyle *style, CellTileType t) { CellTile *res = CHUNK_ALLOC (CellTile, t); *((CellTileType *)&(res->type)) = t; if (style != NULL) { int i = tile_size[t]; gnm_style_link_multiple (style, i); while (--i >= 0) res->style_any.style[i] = style; } return res; }
false
false
false
false
false
0
same(struct cache_entry *a, struct cache_entry *b) { if (!!a != !!b) return 0; if (!a && !b) return 1; if ((a->ce_flags | b->ce_flags) & CE_CONFLICTED) return 0; return a->ce_mode == b->ce_mode && !hashcmp(a->sha1, b->sha1); }
false
false
false
false
false
0
CleanAll(const int show_pnum, const int current_coded_pnum) {// clean out all frames that have expired if (IsPictureAvail(current_coded_pnum)) { for (size_t i=0 ; i<m_pic_data.size() ; ++i) { if ( (m_pic_data[i]->GetPparams().PictureNum() + m_pic_data[i]->GetPparams().ExpiryTime() ) ...
false
false
false
false
false
0
rsrc_print_section (bfd * abfd, void * vfile) { bfd_vma rva_bias; pe_data_type * pe; FILE * file = (FILE *) vfile; bfd_size_type datasize; asection * section; bfd_byte * data; bfd_byte * dataend; bfd_byte * datastart; pe = pe_data (abfd); if (pe == NULL) return TRUE; section = bfd_get_secti...
false
false
false
false
false
0
translate_map_flags(int vm_flags) { int flags = 0; if (vm_flags & VM_MAP_SHARED) flags |= MAP_SHARED; if (vm_flags & VM_MAP_PRIVATE) flags |= MAP_PRIVATE; if (vm_flags & VM_MAP_FIXED) flags |= MAP_FIXED; if (vm_flags & VM_MAP_32BIT) flags |= MAP_32BIT; return flags; }
false
false
false
false
false
0
flipVisibility(bool cascade) { ObjectMap::iterator oi, oiend; oiend = mObjectsByName.end(); for (oi = mObjectsByName.begin(); oi != oiend; ++oi) { oi->second->setVisible(!oi->second->getVisible()); } if (cascade) { ChildNodeMap::iterat...
false
false
false
false
false
0
imx_console_get_options(struct imx_port *sport, int *baud, int *parity, int *bits) { if (readl(sport->port.membase + UCR1) & UCR1_UARTEN) { /* ok, the port was enabled */ unsigned int ucr2, ubir, ubmr, uartclk; unsigned int baud_raw; unsigned int ucfr_rfdiv; ucr2 = readl(sport->port.membase + UCR2); ...
false
false
false
false
false
0
files_changed_callback (NemoDirectory *directory, GList *changed_files, gpointer callback_data) { FMTreeModelRoot *root; GList *node; root = (FMTreeModelRoot *) (callback_data); for (node = changed_files; node != NULL; node = node->next) { process_file_change (root, NEMO_FILE (node->data)); } }
false
false
false
false
false
0
ovl_copy_xattr(struct dentry *old, struct dentry *new) { ssize_t list_size, size, value_size = 0; char *buf, *name, *value = NULL; int uninitialized_var(error); size_t slen; if (!old->d_inode->i_op->getxattr || !new->d_inode->i_op->getxattr) return 0; list_size = vfs_listxattr(old, NULL, 0); if (list_si...
false
false
false
false
true
1
con_packets(instance i, dpacket dp, void *arg) { cni master = (cni)arg; jpacket jp; if(dp == NULL) { log_warn(NAME, "[%s] Err: Sent a NULL dpacket!", FZONE); return r_DONE; } /* routes are from dnsrv w/ the needed ip */ if(dp->type == p_ROUTE) { log_debug(NAME, "[%s] Rejecting ROUTE packet...
false
false
false
false
false
0
operator<<(double f) { REPORT Tracer et("MatrixInput"); if (n<=0) Throw(ProgramException("List of values too long")); *r = (Real)f; int n1 = n-1; n=0; // n=0 so we won't trigger exception return MatrixInput(n1, r+1); }
false
false
false
false
false
0
inject_object(git_indexer *idx, git_oid *id) { git_odb_object *obj; struct entry *entry; struct git_pack_entry *pentry = NULL; git_oid foo = {{0}}; unsigned char hdr[64]; git_buf buf = GIT_BUF_INIT; git_off_t entry_start; const void *data; size_t len, hdr_len; int error; seek_back_trailer(idx); entry_start...
true
true
false
false
false
1
xml_color_save(color_t* color, xmlNodePtr xnode) { xmlNodePtr xsub = xmlNewChild(xnode, NULL, "Color", NULL); char* temp; switch (color->type) { case COLOR_DEFAULT: xmlNewProp(xsub, "type", "Default"); break; case COLOR_FOLDER: xmlNewProp(xsub, "type", "Folder"); ...
false
false
false
false
false
0
printtext_string(void *server, const char *target, int level, const char *text) { TEXT_DEST_REC dest; char *str; g_return_if_fail(text != NULL); format_create_dest(&dest, server, target, level, NULL); if (!sending_print_starting) { sending_print_starting = TRUE; signal_emit_id(signal_print_sta...
false
false
false
false
false
0
oc_huff_tree_collapse(oc_huff_node *_binode, char **_storage){ oc_huff_node *root; size_t size; int mindepth; int depth; int loccupancy; int occupancy; depth=mindepth=oc_huff_tree_mindepth(_binode); occupancy=1<<mindepth; do{ loccupancy=occupancy; ...
false
false
false
false
false
0
close_async_ready_get_info_cb (GOutputStream *stream, GAsyncResult *res, AsyncData *async) { GError *error = NULL; gedit_debug (DEBUG_SAVER); /* check cancelled state manually */ if (g_cancellable_is_cancelled (async->cancellable)) { async_data_free (async); return; } gedit_debug_...
false
false
false
false
false
0
stdout_watch_cb (GIOChannel *source, GIOCondition condition, TotemGalleryProgress *self) { /* Code pilfered from nautilus-burn-process.c (nautilus-cd-burner) under GPLv2+ * Copyright (C) 2006 William Jon McCann <mccann@jhu.edu> */ TotemGalleryProgressPrivate *priv = self->priv; gboolean retval = TRUE; if (condit...
false
false
false
false
false
0
_wi_config_parse_string(wi_config_t *config, wi_string_t *string, wi_string_t **name, wi_string_t **value) { wi_array_t *array; array = wi_string_components_separated_by_string(string, WI_STR("=")); if(wi_array_count(array) != 2) return false; *name = wi_string_by_deleting_surrounding_whitespace(WI_ARRAY(a...
false
false
false
false
false
0
enum_modules(void *cbck, char *item_name, char *item_path) { ModuleInstance *inst; #if CHECK_MODULE QueryInterface query_func; LoadInterface load_func; ShutdownInterface del_func; #ifdef WIN32 HMODULE ModuleLib; #else void *ModuleLib; s32 _flags; #endif #endif GF_ModuleManager *pm = cbck; if (strstr(item_na...
false
false
false
true
false
1
find_dlobj(const char *path) { dlobj *z = NULL; (void)SCM_INTERNAL_MUTEX_LOCK(ldinfo.dso_mutex); for (z = ldinfo.dso_list; z; z = z->next) { if (strcmp(z->path, path) == 0) break; } if (z == NULL) { z = SCM_NEW(dlobj); z->path = path; z->loader = NULL; z->load...
false
false
false
false
false
0
mm_nocritical(MAILSTREAM *stream) { stream = stream; /* For compiler complaints that this isn't used */ if(--critical_depth == 0){ #ifdef SIGHUP (void)signal(SIGHUP, hold_hup); #endif #ifdef SIGUSR2 (void)signal(SIGUSR2, hold_usr2); #endif #ifdef SIGINT (void)signal(SIGINT, hold_int); #endif #ifdef SIGTER...
false
false
false
false
false
0
getHostName() { long hostNameMax = HOST_NAME_MAX; if (hostNameMax < 255) { // https://bugzilla.redhat.com/show_bug.cgi?id=130733 hostNameMax = 255; } string buf(hostNameMax + 1, '\0'); if (gethostname(&buf[0], hostNameMax + 1) == 0) { buf[hostNameMax] = '\0'; return string(buf.c_str()); } else { int e ...
false
false
false
false
false
0
ConvertToFloat ( XMP_StringPtr strValue ) { if ( (strValue == 0) || (*strValue == 0) ) XMP_Throw ( "Empty convert-from string", kXMPErr_BadValue ); XMP_VarString oldLocale; // Try to make sure number conversion uses '.' as the decimal point. XMP_StringPtr oldLocalePtr = setlocale ( LC_ALL, 0 ); if ( oldLocalePtr ...
false
false
false
false
false
0
mod_info_show_close(request_rec * r, const ap_directive_t * dir, int nest) { const char *dirname = dir->directive; mod_info_indent(r, nest, dir->filename, 0); if (*dirname == '<') { if (r) ap_rprintf(r, "&lt;/%s&gt;</tt></dd>", ap_es...
false
false
false
false
false
0
GetNewTransactionId(bool isSubXact) { TransactionId xid; /* * During bootstrap initialization, we return the special bootstrap * transaction id. */ if (IsBootstrapProcessingMode()) { Assert(!isSubXact); MyProc->xid = BootstrapTransactionId; return BootstrapTransactionId; } /* safety check, we should...
false
false
false
false
false
0
plain_load_kernel(CHAR16 *kname, kdesc_t *kd) { INTN ret; fops_fd_t fd; EFI_STATUS status; /* * Moving the open here simplifies the load_elf() error handling */ status = fops_open(kname, &fd); if (EFI_ERROR(status)) return ELILO_LOAD_ERROR; Print(L"Loading %s...", kname); ret = load_elf(fd, kd); fops...
false
false
false
false
false
0
direct_thread_set_name( const char *name ) { char *copy; DirectThread *thread = pthread_getspecific( thread_key ); D_DEBUG_AT( Direct_Thread, "%s( '%s' )\n", __FUNCTION__, name ); /* Support this function for non-direct threads. */ if (!thread) { D_DEBUG_AT( Direct_Thread, "...
false
false
false
false
false
0
tps80031_rtc_read_time(struct device *dev, struct rtc_time *tm) { u8 buff[TPS80031_RTC_TIME_NUM_REGS]; int ret; ret = tps80031_reads(dev->parent, TPS80031_SLAVE_ID1, TPS80031_SECONDS_REG, TPS80031_RTC_TIME_NUM_REGS, buff); if (ret < 0) { dev_err(dev, "reading RTC_SECONDS_REG failed, err = %d\n", ret); retur...
false
false
false
false
false
0
radeon_wait_ring(drm_radeon_private_t * dev_priv, int n) { drm_radeon_ring_buffer_t *ring = &dev_priv->ring; int i; u32 last_head = GET_RING_HEAD(dev_priv); for (i = 0; i < dev_priv->usec_timeout; i++) { u32 head = GET_RING_HEAD(dev_priv); ring->space = (head - ring->tail) * sizeof(u32); if (ring->space <= ...
false
false
false
false
false
0
gsl_diff_backward (const gsl_function * f, double x, double *result, double *abserr) { /* Construct a divided difference table with a fairly large step size to get a very rough estimate of f''. Use this to estimate the step size which will minimize the error in calculating f'. */ int ...
false
false
false
false
false
0
selectHits(FXuint*& hits,FXint& nhits,FXint x,FXint y,FXint w,FXint h){ #ifdef HAVE_GL_H register FXfloat pickx,picky,pickw,pickh; register FXint mh=maxhits; hits=NULL; nhits=0; if(makeCurrent()){ // Where to pick pickx=(wvt.w-2.0f*x-w)/((FXfloat)w); picky=(2.0f*y+h-wvt.h)/((FXfloat)h); pickw...
false
false
false
false
false
0
kmo_vector_divide(cpl_vector *vec1, cpl_vector *vec2) { double *dd1 = NULL, *dd2 = NULL; int size = 0, i = 0; cpl_error_code ret_error = CPL_ERROR_NONE; KMO_TRY { KMO_TRY_ASSURE((vec1 != NULL) && ...
false
false
false
false
false
0
all_one_letter(char *string) { char c; int i; c = string[0]; for(i = 1; string[i] != '\0'; i++) { if(c != string[i]) { return 0; // a nonduplicate letter has been found } c = string[i]; } return 1; // reached the end of the string having found only duplicate letters, so it's all one ...
false
false
false
false
false
0
fill_from_dev_buffer(struct scsi_cmnd *scp, unsigned char *arr, int arr_len) { int act_len; struct scsi_data_buffer *sdb = scsi_in(scp); if (!sdb->length) return 0; if (!(scsi_bidi_cmnd(scp) || scp->sc_data_direction == DMA_FROM_DEVICE)) return (DID_ERROR << 16); act_len = sg_copy_from_buffer(sdb->table....
false
false
false
false
false
0
val_str(String *str) { DBUG_ASSERT(fixed == 1); String *res= args[0]->val_str(str); ulong new_size; int err; uint code; if (!res) goto err; null_value= 0; if (res->is_empty()) return res; /* If length is less than 4 bytes, data is corrupt */ if (res->length() <= 4) { push_warning_pri...
false
false
false
false
false
0
map_addfunc(EditLine *el, const Char *name, const Char *help, el_func_t func) { void *p; int nf = el->el_map.nfunc + 1; if (name == NULL || help == NULL || func == NULL) return (-1); if ((p = el_realloc(el->el_map.func, nf * sizeof(el_func_t))) == NULL) return (-1); el->el_map.func = (el_func_t *) p; if ((p...
false
false
false
false
false
0
BuildAxes( vtkViewport *viewport ) { if ( ( this->GetMTime() < this->BuildTime.GetMTime() ) ) { this->AutoScale( viewport ); return; } if ( this->MaximumAngle < this->MinimumAngle ) { // Incorrect angle input vtkWarningMacro( << "Cannot draw radial axes: " << " mini...
false
false
false
false
false
0
attach_to_feeder_shmem() { char path[MAXPATHLEN]; strncpy(path, config.project_dir, sizeof(path)); get_key(path, 'a', sema_key); int i, retval; void* p; retval = attach_shmem(config.shmem_key, &p); if (retval || p==0) { log_messages.printf(MSG_CRITICAL, "Can't attach shm...
false
false
false
false
false
0
photos_search_type_get_filter (PhotosFilterable *iface) { PhotosSearchType *self = PHOTOS_SEARCH_TYPE (iface); PhotosSearchTypePrivate *priv = self->priv; const gchar *filter; filter = (priv->filter != NULL && priv->filter[0] != '\0') ? priv->filter : ""; return g_strdup (filter); }
false
false
false
false
false
0
read_union_pw_aff_with_dom( __isl_keep isl_stream *s, __isl_take isl_set *dom, struct vars *v) { isl_pw_aff *pa; isl_union_pw_aff *upa = NULL; isl_set *aff_dom; int n; n = v->n; aff_dom = read_aff_domain(s, isl_set_copy(dom), v); pa = read_pw_aff_with_dom(s, aff_dom, v); vars_drop(v, v->n - n); upa = isl_un...
false
false
false
false
false
0
nv50_disp_intr_error(struct nv50_disp *disp, int chid) { struct nvkm_subdev *subdev = &disp->base.engine.subdev; struct nvkm_device *device = subdev->device; u32 data = nvkm_rd32(device, 0x610084 + (chid * 0x08)); u32 addr = nvkm_rd32(device, 0x610080 + (chid * 0x08)); u32 code = (addr & 0x00ff0000) >> 16; u32 ty...
false
false
false
false
false
0
conn_close_fd(EpmdVars *g,int fd) { int i; for (i = 0; i < g->max_conn; i++) if (g->conn[i].fd == fd) { epmd_conn_close(g,&g->conn[i]); return EPMD_TRUE; } return EPMD_FALSE; }
false
false
false
false
false
0
wi_file_compress_at_path(wi_file_t *file, wi_string_t *path, wi_integer_t level) { FILE *source; FILE *dest; int ret, flush; unsigned have; z_stream strm; unsigned char in[CHUNK]; unsigned char out[CHUNK]; /* Check input and output files */ if (NULL == (source = fdopen(file->fd, "r"))) ...
false
false
false
false
true
1
print_help(struct cliopts_priv *ctx, const char *progname) { cliopts_entry *cur; cliopts_entry helpent = { 0 }; char helpbuf[512] = { 0 }; helpent.klong = "help"; helpent.kshort = '?'; helpent.help = "this message"; fprintf(stderr, "Usage:\n"); fprintf(stderr, " %s [OPTIONS...]\n\n", ...
false
false
false
false
false
0
sp_event_handlers_toggle (splotd *sp, gboolean state, ProjectionMode pmode, InteractionMode imode) { displayd *display = (displayd *) sp->displayptr; /* scatmat and parcoords are handling everything now and returning false; ts and barchart are handling their own and then returning to the switch statemen...
false
false
false
true
false
1
merge_cat_star_list_to_window(gpointer window, GList *addsl) { struct wcs *wcs; struct gui_star_list *gsl; wcs = gtk_object_get_data(GTK_OBJECT(window), "wcs_of_window"); if (wcs == NULL || wcs->wcsset == WCS_INVALID) { err_printf("merge_cat_star_list_to_window: invalid wcs\n"); return -1; } gsl = gtk_object...
false
false
false
false
false
0
snapshot_merge_next_chunks(struct dm_snapshot *s) { int i, linear_chunks; chunk_t old_chunk, new_chunk; struct dm_io_region src, dest; sector_t io_size; uint64_t previous_count; BUG_ON(!test_bit(RUNNING_MERGE, &s->state_bits)); if (unlikely(test_bit(SHUTDOWN_MERGE, &s->state_bits))) goto shut; /* * valid ...
false
false
false
false
false
0
show_top5_leaders_size () { int i = 0; for (; i <= last_index; i++) { int leader_size = leaders[i]; if (leader_size > 0) { if (leader_size > top5_leaders_size[0]) { insert_top5 (0, leader_size); } else if (leader_size > top5_leaders_size[1]) { ...
false
false
false
false
false
0
hfi1_dbg_ibdev_init(struct hfi1_ibdev *ibd) { char name[sizeof("port0counters") + 1]; char link[10]; struct hfi1_devdata *dd = dd_from_dev(ibd); struct hfi1_pportdata *ppd; int unit = dd->unit; int i, j; if (!hfi1_dbg_root) return; snprintf(name, sizeof(name), "%s_%d", class_name(), unit); snprintf(link, si...
true
true
false
false
true
1
increase_buffer_size(void) { char *new_section_buffer; new_section_buffer = (char *) malloc(2 * section_buffer_size + 1); if (new_section_buffer == NULL) diagnostics(ERROR, "Could not allocate enough memory to process file. Sorry."); memmove(new_section_buffer, section_buffer, section_buffer_si...
false
false
false
false
false
0
SearchBottomBlock(Block *bHead) { Block *botBlk = bHead; while(botBlk->next != NULL){ botBlk = botBlk->next; } return(botBlk); }
false
false
false
false
false
0
CDB___bam_setovflsize(dbp) DB *dbp; { BTREE *t; t = dbp->bt_internal; /* * !!! * Correction for recno, which doesn't know anything about minimum * keys per page. */ if (t->bt_minkey == 0) t->bt_minkey = DEFMINKEYPAGE; /* * The btree data structure requires that at least two key/data pairs * can f...
false
false
false
false
false
0
parse_line (char *line, SourceType type) { char *z, *token; int value; HashEntry *entry; z = line; if (strncmp (z, "#define ", 8)) return; z += 8; token = z + 2; for (; *z && *z != ' '; z++); *z = 0; z++; for (; *z == ' '; z++); value = atoi (z); /* printf ("%d Token: /%s/, value=%d\n", type, token, v...
false
true
false
false
true
1